Networking
NFS 共享、權限、掛載和導出文件上的“只讀文件系統”似乎沒問題
我通過 NFS
/share/global/usr/share
從伺服器共享到客戶端。/usr/share
當客戶端寫入它時,我收到“只讀文件系統”錯誤。伺服器
文件系統權限正常:
$> ls -la /share/global/usr/ drwxrwxrwx 2 nobody nogroup 4096 Dec 6 14:37 share
客戶端 IP 的導出為 rw
192.168.101.250
,其他內部 IP 為 ro。$> grep usr /etc/exports /share/global/usr/share 192.168.0.0/16(ro,subtree_check,all_squash) 192.168.101.250(rw,subtree_check,all_squash)
伺服器可以在這裡寫:
$> echo HELLO > /share/global/usr/share/REMOVEME && chmod 666 /share/global/usr/share/REMOVEME && echo ok ok
客戶
IP 地址匹配(靜態):
$> ip addr | grep inet inet 192.168.101.250/24 brd 192.168.101.255 scope global enp0s8
fstab 指定 rw:
$> grep usr /etc/fstab 192.168.101.254:/share/global/usr/share /usr/share nfs rsize=8192,wsize=8192,timeo=3,intr,rw
它已安裝 rw:
$> mount | grep usr 192.168.101.254:/share/global/usr/share on /usr/share type nfs4 (rw,relatime,vers=4.0,rsize=8192,wsize=8192,namlen=255,hard,proto=tcp,port=0,timeo=3,retrans=2,sec=sys,clientaddr=192.168.101.250,local_lock=none,addr=192.168.101.254)
閱讀沒問題:
$> ls -al /usr/share/REMOVEME -rw-rw-rw-. 1 nfsnobody nfsnobody 7 Dec 6 15:14 /usr/share/REMOVEME
問題
在客戶端:
$> sudo -i $> echo foo > /usr/share/REMOVEME -bash: /usr/share/REMOVEME: Permission denied
我也無法在這裡創建新文件。
配置中的所有內容對我來說都不錯。為什麼我不能寫入客戶端上的共享目錄?
伺服器是 Ubuntu 16.04,客戶端是 CentOS 7。
/etc/exports
希望特定的 IP 地址首先出現,IP 範圍在後面。IE
/share/global/usr/share 192.168.101.250(rw,subtree_check,all_squash) 192.168.0.0/16(ro,subtree_check,all_squash)