透過 NFSv4 的資料夾共享對使用者群組私有

透過 NFSv4 的資料夾共享對使用者群組私有

我想透過 NFSv4 共用一個可供某些使用者使用的資料夾,但我遇到了權限問題。

我使用 setGID 設定資料夾權限,以便使用資料夾群組擁有者建立新檔案。但使用者可以自由建立檔案而無需群組權限(事實上,預設使用者UMASK是700,所以這種情況經常發生)。

我最終嘗試申請該解決方案使用 ACL 強制目錄 umask。我做到了,但它沒有按預期工作。我讀到極速快感維基常規 ACL 無法在 NFSv4 上運作,而且我需要使用 nfs4 特定的 ACL 工具。

但我遇到了一些麻煩。我嘗試在伺服器上安裝 nfs4-acl-tools 並得到以下資訊:

# nfs4_getfacl /export/proyectos/
Operation to request attribute not supported.

是的,該分割區安裝時支援 ACL。

/dev/mapper/mpath4-part1 /export/proyectos ocfs2 rw,relatime,_netdev,heartbeat=local,nointr,data=ordered,errors=remount-ro,usrquota,coherency=full,user_xattr,acl 0 0

常規 ACL 正在運行:

# getfacl /export/proyectos/
getfacl: Eliminando «/» inicial en nombres de ruta absolutos
# file: export/proyectos/
# owner: root
# group: root
# flags: --t
user::rwx
group::rwx
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx

我按照建議追蹤了 nfs4_getfacl郵件清單並得到這個:

# strace nfs4_getfacl /export/proyectos
<stripped>
getxattr("/export/proyectos", "system.nfs4_acl", 0x0, 0) = -1 EOPNOTSUPP (Operation not supported)
<stripped>

nfs4_getfacl 是否要求正確的標誌?我認為 nfs4_acls 根本沒有被任何檔案系統實現,並且當前 nfs4 依賴某種 nfs4acl-posixacl 映射。但我不再確定了。

答案1

您必須getfacl在 NFS 伺服器上使用(因為您查詢本機檔案系統),並nfs4_getfacl在 NFS 用戶端上使用。

NFSv4 ACL 和 Linux ACL acl(5) 是完全不同的標準! Linux NFS 伺服器將來回轉換 ACL。

閱讀貼文Linux 中的 nfs 掛載上沒有 acl?

相關內容