參考地址:http://www.linuxidc.com/Linux/2009-07/20998.htm
錯誤參考:http://liuzhigong.blog.163.com/blog/static/17827237520115305226932/
$sudo aptitude install nfs-kernel-server
修改nfs設定檔/etc/exports,添加如下一行
/home/m/.wkl/soft *(insecure,rw,no_root_squash,no_subtree_check)
$sudo /etc/init.d/portmap start
# /etc/init.d/nfs-kernel-server restart //$sudo /etc/init.d/nfsstat start
$sudo mount -o nolock 192.168.1.117:/home/m/.wkl/soft ~/wklshare (wklshare需要建立 117為虛擬機器)
原文:http://general.blog.51cto.com/927298/354523
ro 唯讀訪問
rw 讀寫訪問
sync 所有資料在請求時寫入共用
async NFS在寫入資料前可以相應請求
secure NFS通過1024以下的安全TCP/IP連接埠發送
insecure NFS通過1024以上的連接埠發送
wdelay 如果多個使用者要寫入NFS目錄,則歸組寫入(預設)
no_wdelay 如果多個使用者要寫入NFS目錄,則立即寫入,當使用async時,無需此設定。
hide 在NFS共用目錄中不共用其子目錄
no_hide 共用NFS目錄的子目錄
subtree_check 如果共用/usr/bin之類的子目錄時,強制NFS檢查父目錄的許可權(預設)
no_subtree_check 和上面相對,不檢查父目錄許可權
all_squash 共用檔案的UID和GID映射匿名使用者anonymous,適合公用目錄。
no_all_squash 保留共用檔案的UID和GID(預設)
root_squash root使用者的所有請求映射成如anonymous使用者一樣的許可權(預設)
no_root_squas root使用者具有根目錄的完全管理存取權限
anonuid=xxx 指定NFS伺服器/etc/passwd檔案中匿名使用者的UID
anongid=xxx 指定NFS伺服器/etc/passwd檔案中匿名使用者的GID
完