Samba不單單能夠用於Linux與Windows之間的文件共享,也能夠用於在Linux與Linux之間進行文件的共享,是一個功能十分強的工具,能夠將共享文件夾直接掛載,就像是訪問u盤同樣來訪問共享文件夾,十分便捷。python
首先須要安裝cifs-utils:bash
sudo apt-get install cifs-utils
而後新建一個文件夾來進行掛載(也能夠在別的文件夾,/mnt一般做爲掛載點)服務器
mkdir /mnt/shareide
服務器共享的目錄全稱//192.168.1.5/pi(或者//SAMBA/pi) 用戶名:pi 密碼:12345678工具
而後就能夠將共享文件夾掛載在/mnt/share下
!注意事先不要cd 到/mnt/share
mount.cifs //192.168.1.6/pi /mnt/share -o username=pi
mount.cifs //192.168.1.23/sh /share
而後輸入密碼後回車ui
而後如今能夠看到已經掛載成功.net
[root@localhost ~]# cd /mnt/share/
[root@localhost share]# ls
Desktop Downloads Music opencv Public STUDY Videos
Documents GYY oldconffiles Pictures python_games Templates WORK
若是想開機自動掛載能夠修改/etc/fstab,在最後一行添加code
//172.17.1.200/share(遠程共享目錄) /mnt/share(本地那個目錄) cifs(文件系統類型) defaults,uid=1000,gid=1000,username=登錄用戶名, passwd=登錄密碼 0 0
可是開機自動掛載這個我沒有弄出來,開機時確實會去進行掛載但仍是要我手動輸入密碼ci
sudo apt-get install cifs-utils mkdir /share cd / mount.cifs //192.168.1.23/sh /share #無密碼 -o username=u