OpenIndianaをActive Directoryに加入させる
基本的にOracle Solaris 11のやり方で加入させることができますが、OpenIndianaに実装されていないコマンドもありますので一部の手順が異なります。
素のOpenIndianaをActive Driectory連携させてzfsのsmb shareでファイルサーバーにしようとしている記事がないのでまとめ。
ネタ元(リンク切れてるので Internet Archiveからサルベージ)
設定ファイルの変更
Section titled “設定ファイルの変更”OpenIndianaではsvccfgで設定できない項目があるので手動で設定ファイルを変更します。
設定変更後、システムを再起動させずに設定を反映させる方法がわからないので再起動します。
domain ad.example.comsearch ad.example.comnameserver 192.168.100.203nameserver 192.168.100.205#該当する行にadを追加passwd: files adgroup: files ad実際に加入させる
Section titled “実際に加入させる”トラブルが起こると面倒なので Active Directory 側で事前にコンピューターアカウントを作成しておきます。
# smbadm join -u Administrator ad.example.comAfter joining ad.example.com the smb service will be restarted automatically.Would you like to continue? [no]: yEnter domain password: xxxxxJoining 'vbox.oracle.com' ... this may take a minute ...Successfully joined domain 'ad.example.com'パスワードを入力すると自動的にシステムの各種設定が行われ、加入手続きが完了します。
SMBに関するのコマンドメモ
Section titled “SMBに関するのコマンドメモ”sharectl set -p restrict_anonymous=true smbZFS ACL等のコマンドメモ
Section titled “ZFS ACL等のコマンドメモ”このあたりはSolaris 11のコマンドが一通り使えそうな感じです。
ちゃんとドメインのユーザーを取得できるか確認 ここでちゃんとUIDとGIDが出るならZFSのACLを設定できる
# id username@ad.example.comuid=2147003601(username@ad.example.com) gid=2147003601(Domain Users@ad.example.com)Active Directoryに最初からある特別なグループは@BUILTINで引くことができる 例えば管理者権限を持つユーザーにアクセスを全部認めるような指定を行う際に使う。
# id Administrators@BUILTINuid=2147483653(Administrators@BUILTIN) gid=2147483662(Administrators@BUILTIN)vがacl確認スイッチ
$ ls -vl /zpooldrwxr-xr-x 4 root root 4 4月 21 2021 volume 0:everyone@:list_directory/read_data/read_xattr/execute/read_attributes /read_acl/synchronize: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_attributesacl新規設定
Section titled “acl新規設定”この場合rootにフルアクセスを認めつつそれを子ディレクトリとファイルに継承するACLを新規作成する
# chmod -R A+user:root:full_set:file_inherit/dir_inherit:allow /zpool/volumeドメインのユーザーを指定するならこうする
# chmod -R A+user:username@ad.example.com:full_set:file_inherit/dir_inherit:allow /zpool/volume誰でも読むことだけできる状態にするならこうする
chmod -R A+everyone@:read_set:file_inherit/dir_inherit:allow /zpool/volumels -lvで確認した3番目のACLを編集する
chmod A3=user:venkman@ad.example.com:read_set:file_inherit/dir_inherit:allow /zpool/volumels -lvで確認した0番目のACLを削除する
# chmod A0- /zpool/volumeZFS ACL セット
Section titled “ZFS ACL セット”上記コマンドで設定する引数の意味
| ACL セット名 | 含まれる ACL アクセス権 |
|---|---|
| full_set | すべてのアクセス権 |
| modify_set | write_acl と write_owner を除くすべてのアクセス権 |
| read_set | read_data、read_attributes、 read_xattr、および read_acl |
| write_set | write_data、append_data、write_attributes 、および write_xattr |
ZFS ACL 継承フラグ
Section titled “ZFS ACL 継承フラグ”| 継承フラグ | 説明 |
|---|---|
| file_inherit | 親ディレクトリの ACL をそのディレクトリのファイルにのみ継承します。 |
| dir_inherit | 親ディレクトリの ACL をそのディレクトリのサブディレクトリにのみ継承します。 |
| inherit_only | 親ディレクトリから ACL を継承しますが、新しく作成したファイルまたはサブディレクトリにのみ適用され、そのディレクトリ自体には適用されません。このフラグを使用する場合は、何を継承するかを指定するために、file_inherit フラグまたは dir_inherit フラグ、あるいはその両方を指定する必要があります。 |
