linux系統下掛載windows共用目錄

來源:互聯網
上載者:User

標籤:

在工作中有時我們需要在linux上掛載windows共用目錄。首先我們需要學會在linux上查看windows共用了那些目錄。查看操作需要安裝samba-client

[[email protected]5201351 ~]# yum install samba-client -y   //安裝samba用戶端

安裝好samba-client之後,接下來就是查看windows主機上的共用資源,查看的命令如下:

[[email protected]5201351 ~]# smbclient -L 192.168.100.1 -U administrator    // 顯示伺服器端所分享出來的所有資源清單,-U是指定使用者名稱

筆者的實驗結果如所示,其中share-test是我windows主機上共用的目錄:

以上命令只是查詢服務端共用了那些資源,我們還需要考慮怎麼將資源掛載到本地來,方便增刪查改,我們可以使用如下命令進行掛載。

[[email protected]5201351 ~]# mount -t cifs -o username=administrator,password=123456 //192.168.100.1/share-test /mnt/windows

其中cifs為掛載類型,cifs即是Common Internet File System的縮寫,通用Internet檔案系統

在windows主機之間進行網路檔案分享權限設定是通過使用微軟公司自己的CIFS服務實現的。

上面命令中的//192.168.100.1/share-test為windows服務端上的共用目錄。

也即把windows上的share-test目錄共用的內容掛載到linux下的/mnt/windows目錄。

此命令掛載共用目錄在重啟後會失效、若想每次開機都生效、可以在/etc/fstab檔案末尾加入以下內容:

//192.168.100.1/share-test /mnt/windows   cifs   defaults,username=administrator,password=123456   0 0

 

linux系統下掛載windows共用目錄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.