ディレクトリ内のすべての新しいファイル/フォルダが必要です。/var/www/会社ユーザーを所有するためのすべてのサブディレクトリ会社とグループwww-データ。
そのため、ACLを次のように設定しました。
$ getfacl /var/www/company/
getfacl: Removing leading '/' from absolute path names
# file: var/www/company/
# owner: company
# group: www-data
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:company:rwx
default:group::r-x
default:group:www-data:rwx
default:mask::rwx
default:other::r-x
ただし、たとえば、新しいファイルを作成すると、touch foo
ユーザーとグループの両方が次に設定されます。会社:
-rw-rw-r--+ 1社 company0 6月30日 09:52 foo
$ getfacl foo
# file: foo
# owner: company
# group: company
user::rw-
user:company:rwx #effective:rw-
group::r-x #effective:r--
group:www-data:rwx #effective:rw-
mask::rw-
other::r--
$ id company
uid=1000(company) gid=33(www-data) groups=33(www-data),27(sudo)
ベストアンサー1
ACL は、新しいオブジェクトの基本グループとは無関係です。 Linuxで可能な唯一のアクションは、親ディレクトリと同じグループを強制することです。これを行うには、ディレクトリのSGIDビットを設定する必要があります。
chmod g+s /var/www/company