少し難しいです。 zfs/nfsv4 aclでposix aclデフォルトを複製する方法は?

少し難しいです。 zfs/nfsv4 aclでposix aclデフォルトを複製する方法は?

生成されたすべてのファイルとディレクトリがそのディレクトリのグループ所有者のグループ権限を持ち、デフォルトの権限が770のディレクトリが必要な場合を考えてみましょう。 posix ACLの使用は本当に簡単です。

#create a dir..
mkdir proof

#inherit group permission "video" in this example
chmod g+s proof/
chgrp video proof/

#with setfacl make the default group with rxw permissions
setfacl -d -m g:video:rwx proof

#other are not allowed
setfacl -d -m o:--- proof/
chmod o-x proof

#give the acl
setfacl -m g:video:rwx proof

次に、ディレクトリ証明にファイルとディレクトリを作成します。

mkdir try1
drwxrws---+ 2 myuser video 4,0K feb 23 01:26 try1
touch file1
-rw-rw----+ 1 myuser video    0 feb 23 01:29 file1

ご覧のとおり、欲しいものを手に入れました。ディレクトリ内のすべてのファイルは権限を継承し、グループ所有者として「video」グループを持ちます。これはLinux(ext4、btrfsなどのposix acl)とSolaris(ufs)で可能です。

これで問題は、nfsv4 aclを使用してSolarisからzfsでこれを行う方法です。 zfs Solaris 11ホストで別のディレクトリ「証明」を作成してみました(chmod g + sがもちろん作成しました)。

chmod A=owner@:read_attributes/read_data/execute/list_directory/read_data/write_data/append_data/execute/add_file/add_subdirectory:fd:allow,group:video:read_attributes/read_data/execute/list_directory/read_data/write_data/append_data/execute/add_file/add_subdirectory:fd:allow,everyone@:read_attributes/read_data/execute/list_directory/read_data/write_data/append_data/execute/add_file/add_subdirectory:fd:deny proof

しかし結果は...

mkdir newdir
drwxr-sr-x+ 2 myuser video 2 23 feb 02.33 newdir

:|

同じposix aclを取得する方法は?ありがとう

ベストアンサー1

解決策が見つかりました。ユーザー+グループビデオ用に770が必要です。

a) zfs ボリュームの作成

zfs create proof1

b) 非常に重要です。それ以外の場合は動作しません!

zfs set aclinherit=passthrough rpool/proof1

c) 今ACL

chmod g+s /proof1
chgrp video /proof1

#this if you don't share the dir via nfs
chmod A=owner@:full_set:fd:allow,group:video:full_set:fd:allow,everyone@:full_set:fd:deny /proof1

#this if you want to share it via nfs
chmod A=owner@:full_set:fd:allow,group:video:full_set:fd:allow,everyone@:read_set:allow /proof1

fd はファイルとディレクトリの継承を表します。

d) ファイルとディレクトリを作成します。

mkdir dir1 
touch file1

drwxrws---+ 2 root video 2 23 feb 02.59 dir1
-rwxrwx---+ 1 root video 0 23 feb 02.59 file1

完璧。ローカルファイルでテストしましたが、ビデオグループに属しているユーザーだけがそのディレクトリに書き込むことができます。

おすすめ記事