ubuntu16.04 NFS系統掛載

一:服務器端

step1:關閉防火牆服務器

sudo ufw disable 

step2:安裝nfsrest

sudo apt-get install nfs-kernel-server

step3:server

打開/etc/exports文件,在末尾加入:/home/daysmark/nfsdir*(rw,sync,no_root_squash)blog

注:nfs容許掛載的目錄及權限,在文件/etc/exports中進行定義,各字段含義以下:get

/home/daysmark/nfsdir:要共享的目錄同步

*:容許全部的網段訪問it

rw:讀寫權限class

sync:資料同步寫入內在和硬盤cli

no_root_squash:nfs客戶端共享目錄使用者權限服務器端

重啓服務:

#sudo /etc/init.d/nfs-kernel-server restart      //重啓nfs服務
#showmount -e                                            //顯示共享出的目錄

 

二:客戶端

nfsclient端安裝和配置

(1)安裝nfsclient

sudo apt-get install nfs-common

 

(2)查看nfsserver上共享的目錄

 

#sudo mount -t nfs 192.168.0.149: /home/daysmark/nfsdir /mnt

 

192.168.0.149爲服務器端IP地址這樣就把共享目錄掛到了/mnt目錄

取消掛載用這個指令:#sudo umount /mnt

相關文章
相關標籤/搜索