筆記:linux訪問windows共用

來源:互聯網
上載者:User

標籤:linux訪問windows共用

Linux訪問Windows共用有兩種方法:

方法一:mount掛載

建立一個掛載點:

[[email protected] mnt]# mkdir /mnt/myshare

掛載:

[[email protected] mnt]#  mount -t cifs -o username=lee //192.168.8.1/Share /mnt/myshare/

幾個參數的具體含義:

cifs:Common Internet File System,#可以理解為網路檔案系統。usrname:#訪問共用資料夾的使用者名稱password:#訪問密碼(我這裡並沒有明文輸入)//192.168.66.198/share:#表示網路檔案夾的地址,注意這裡最後不能加/,如果是//192.168.66.198/share/則會報如下錯誤:mount: //192.168.66.198/share/ is not a valid block device

開機自動掛載:

[[email protected] mnt]# vim /etc/fstab //192.168.8.1/Share     /mnt/myshare cifs defaults,username=lee,password=******* 0 2[[email protected] mnt]# mount -a

方法二:samba-client

先查看下有沒有安裝Sambaclient

[[email protected] myshare]# rpm -qa | grep samba

沒有的話安裝Samba用戶端:

[[email protected] myshare]# yum install samba-client

查看windows共用資料夾:

[[email protected] myshare]# smbclient -U lee -L //192.168.8.1

操作windows共用資料夾:

[[email protected] myshare]# smbclient -U lee //192.168.8.1/ShareEnter lee‘s password: Domain=[DANNYLEE] OS=[Windows 10 Enterprise 10240] Server=[Windows 10 Enterprise 6.3]smb: \>  #表示進入sambaclient的內部命令:smb: \> help #查看smb可用命令smb: \> help get #查看具體命令使用方法HELP get:<remote name> [local name] get a filesmb: \>ls #查看共用資料夾中的檔案

從共用資料夾下載一個檔案:

smb: \> get 3389.txt /lee/bak/test.txt

上傳一個檔案到共用資料夾:

smb: \> put /lee/bak/test.txt test.txt

其它命令略。


筆記: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.