Ⅱ 7.訪問網絡文件共享服務
#一.cifs#
1.yum installsamba-client -y #安裝samba服務
2.smbclient -L //服務器ip #登錄服務器
3.smbclient //服務器ip/sharedir #進入服務器共享目錄
4.mount //ip服務器/sharedir/mountpoint -ousername=guest #將服務器共享目錄掛載到本機目錄,
#解決兩個系統匿名用戶名不一致 -ousername=guest
5.vim /etc/fstab#開機自動掛載
//服務器ip/sharename/mountpoint cifsdefaults,username=guest 0 0
mount -a
#二.nfs#
手動掛載方式
1)yum installnfs-utils.x86_64 -y#安裝nfs服務
2)showmount -e 服務器ip #查看服務器可掛載設備
3)mount 服務器ip:/sharedir/mountpoint #掛載服務器共享目錄到主機
自動掛載方式
1)yum installautofs -y #安裝autofs服務
2)systemctl startautofs #啓動autofs服務
3)cd /net/服務器ip/
4)vim /etc/syscofig/autof/s
TIMEOUT=5#不再使用的掛載存在時間
自定義掛載方式
vim /etc/auto.master #主配置文件
/westos /etc/auto.westos
vim /etc/auto.westos #自配置文件
* 服務器ip:/nfsshare/&
systemctl restart autofs#重啓服務