NexentaStor はファイルシステムが ZFS なので柔軟な権限設定ができます。
例えば安い NAS だとID/PW 認証はできても、細かい権限の設定はできなくて、ファイルやディレクトリののプロパティを開いても画像のようなセキュリティタブが出てこないということが多々あります。それに対して NexentaStor は Windows Server と同じようにセキュリティタブが表示され、ACL ベースの権限設定ができます。ちなみにスナップショットはシャドウコピーのように見えます。GUI で設定する時はこれでも困らないのですが、今日は大量のファイルの ACL を付け替えたかったので CUI のコンソールから ACL を書き換える方法を調べてみました。
あらかじめ下記のコマンドでエキスパートモードになっておく必要があります(但し、bashは起動しない)。
nmc@nexenta:/$ option expert_mode=1 -s
下記の例は vol0 に対して foobar というグループに所謂フルコントロールを付与するためのコマンドです。
どちらも同じ意味ですが上段が冗長形式、下段がコンパクト形式です。
nmc@nexenta:/$ chmod A+group:foobar:list_directory/read_data/add_file/write_data/add_subdirectory/append_data/read_xattr/write_xattr/execute/delete_child/read_attributes/write_attributes/delete/read_acl/write_acl/write_owner/synchronize:file_inherit/dir_inherit/inherited:allow vol0
nmc@nexenta:/$ chmod A+group:foobar:rwxpdDaARWcCos:fd----I:allow vol0
どちらも同じ指定ですが、冗長形式はわかりにくいのでコンパクト形式をイディオム的に覚えた方が良さそうですね。
† 実際にACL を操作してみるとこんな感じ
ちなみにファイルやディレクトリに設定されている ACL を表示させるためには ls に -v(冗長モード)もしくは-V(コンパクト形式)をつける必要があるようです。
これをつけていないと、 drwxr-xr-x+ の最後の + の部分しか変化がないのでACLが付いていることに気づかないかもしれません。
nmc@nexenta:/$ ls -ld vol0
drwxr-xr-x 2 root root 2 Oct 2 22:25 vol0
nmc@nexenta:/$ ls -ldV vol0
drwxr-xr-x 2 root root 2 Oct 2 22:25 vol0
owner@:rwxp-DaARWcCos:-------:allow
group@:r-x---a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
nmc@nexenta:/$ ls -ldv vol0
drwxr-xr-x 2 root root 2 Oct 2 22:25 vol0
0:owner@:list_directory/read_data/add_file/write_data/add_subdirectory
/append_data/read_xattr/write_xattr/execute/delete_child
/read_attributes/write_attributes/read_acl/write_acl/write_owner
/synchronize:allow
1:group@:list_directory/read_data/read_xattr/execute/read_attributes
/read_acl/synchronize:allow
2:everyone@:list_directory/read_data/read_xattr/execute/read_attributes
/read_acl/synchronize:allow
nmc@nexenta:/$ chmod A+group:foobar:rwxpdDaARWcCos:fd----I:allow vol0
nmc@nexenta:/$ ls -ld
drwxr-xr-x+ 5 root root 5 Oct 2 22:25 .
nmc@nexenta:/$ ls -ldV vol0
drwxr-xr-x+ 2 root root 2 Oct 2 22:25 vol0
group:foobar:rwxpdDaARWcCos:fd----I:allow
owner@:rwxp-DaARWcCos:-------:allow
group@:r-x---a-R-c--s:-------:allow
everyone@:r-x---a-R-c--s:-------:allow
nmc@nexenta:/$ ls -ldv vol0
drwxr-xr-x+ 2 root root 2 Oct 2 22:25 vol0
0:group:foobar:list_directory/read_data/add_file/write_data
/add_subdirectory/append_data/read_xattr/write_xattr/execute
/delete_child/read_attributes/write_attributes/delete/read_acl
/write_acl/write_owner/synchronize:file_inherit/dir_inherit
/inherited:allow
1:owner@:list_directory/read_data/add_file/write_data/add_subdirectory
/append_data/read_xattr/write_xattr/execute/delete_child
/read_attributes/write_attributes/read_acl/write_acl/write_owner
/synchronize:allow
2:group@:list_directory/read_data/read_xattr/execute/read_attributes
/read_acl/synchronize:allow
3:everyone@:list_directory/read_data/read_xattr/execute/read_attributes
/read_acl/synchronize:allow
† 参考
・ZFS ファイルの ACL を冗長形式で設定および表示する - Oracle Solaris ZFS 管理ガイド
・ZFS ファイルの ACL をコンパクト形式で設定および表示する - Oracle Solaris ZFS 管理ガイド