
我真的不知道我在這裡做什麼,所以對於任何缺乏清晰度或精確性的地方,我深表歉意。
我有一個 Fedora 27 工作站和伺服器。伺服器配置為共享/home/nfs
NFS 伺服器上呼叫的資料夾。該伺服器之前運行的是舊版本的 NFS,現在我相信我預設使用 NFSv4。升級後,我無法寫入掛載的 NFS 共享~/nas
這是我能想到的所有相關資訊。我沒有關注user-id,所以它們都是自動生成的。
# exportfs -v outputs:
/home/nfs <world>(rw,sync,wdelay,hide,no_subtree_check,fsid=0,sec=sys,secure,no_root_squash,no_all_squash)
# The permissions of the mount folder:
drwxrwxr-x. 18 nobody nobody 4096 Mar 8 20:09 nas
# Try to 'touch ~/nas':
touch: setting times of '/home/stg/nas': Permission denied
# Try to touch ~/nas/t
touch: cannot touch '/home/stg/nas/t': Permission denied
# reading files works fine.
# sudo lets me write to files.
# cat /proc/mounts:
hal:/ /home/stg/nas nfs4 rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp6,time
# on the server side, 'ls -ll /home/' gives:
drwxrwxr-x. 18 nobody nobody 4096 Mar 10 11:38 nfs
我可以透過在伺服器上運行來使資料夾可寫chmod o+w nfs
,但這似乎是錯誤的做法——在 NFSv3 下,現有權限有效。我嘗試將客戶端用戶新增至無人群組(這看起來很奇怪),但沒有效果。
有人可以跟我解釋我做錯了什麼嗎?
答案1
取得這些權限後,您需要處於nobody
、 或 群組中nobody
才能寫入此目錄。所以你走這條路的冒險是正確的。
修改使用者群組後,您需要重新啟動會話,因為這些群組不是動態的。
這個問題為這個問題提供了一些解決方案:無需登出即可重新載入 Linux 使用者的群組分配。但請注意,這些解決方案通常涉及建立新的臨時會話,並且在桌面環境中,重新啟動可能是最佳選擇。