I'm trying to figure out how you properly run setfacl(1) on a directory and its contents without letting the execute permission "x" get assigned to files. I've been reading the forums and documentation the past few days, as well as trying different outcomes, and nothing seems to work.
This is on 14.3-RELEASE-p7 with ZFS, so NFSv4 ACLs are required. ZFS properties are configured with
I have a web server that needs multiple developers to have the ability to modify files under certain directories. They will also need the ability to create directories within them. I use nginx and I'm wanting the www user to have read-only permissions.
My first attempts had me creating a "developers" group. The default permissions on my web root folder is owned by root:wheel and 0755 (on directories) and 0644 (on files). On the specific folders that the users need to modify, I've changed permissions to be root:developers and 0775 (on directories) and 0664 (on files).
This works, technically. The problems arise when new files are created. The files being created need to be 0664, but are being created as 0644. So just set the umask to 0002 and call it a day. However, I'm not sure how to reliably set the umask for all users across multiple methods of creating files. They can be ssh'd in or they can be scp'ing, maybe even using an app like WinSCP. And I only care about the umask being set for these specific directories/files.
That led me to
My understanding is that I can simply run:
This does work, but it applies the same set of permissions to both directories and files. I don't want "x" or execute on files. I cannot find anywhere that explains if this is even possible.
I have seen these discussions already:
https://forums.freebsd.org/threads/...not-working-being-updated-with-setfacl.82298/
https://forums.freebsd.org/threads/trouble-with-acls-setfacl.77121/
https://forums.freebsd.org/threads/do-correct-order-for-nfsv4-acl-with-setfacl-in-scripts.96444/
http://bsdwiki.reedmedia.net/wiki/View_and_modify_ACLs.html
If you can offer any help, it would be much appreciated.
This is on 14.3-RELEASE-p7 with ZFS, so NFSv4 ACLs are required. ZFS properties are configured with
passthrough.
Code:
aclmode passthrough
aclinherit passthrough
I have a web server that needs multiple developers to have the ability to modify files under certain directories. They will also need the ability to create directories within them. I use nginx and I'm wanting the www user to have read-only permissions.
My first attempts had me creating a "developers" group. The default permissions on my web root folder is owned by root:wheel and 0755 (on directories) and 0644 (on files). On the specific folders that the users need to modify, I've changed permissions to be root:developers and 0775 (on directories) and 0664 (on files).
Code:
chown -R root:wheel /usr/local/www/website/
chown -R root:developers /usr/local/www/website/public_html/modules
chown -R root:developers /usr/local/www/website/public_html/plugins
find /usr/local/www/website -type d -exec chmod 0755 {} \;
find /usr/local/www/website -type f -exec chmod 0644 {} \;
find /usr/local/www/website/public_html/modules -type d -exec chmod 0775 {} \;
find /usr/local/www/website/public_html/modules -type f -exec chmod 0664 {} \;
find /usr/local/www/website/public_html/plugins -type d -exec chmod 0775 {} \;
find /usr/local/www/website/public_html/plugins -type f -exec chmod 0664 {} \;
This works, technically. The problems arise when new files are created. The files being created need to be 0664, but are being created as 0644. So just set the umask to 0002 and call it a day. However, I'm not sure how to reliably set the umask for all users across multiple methods of creating files. They can be ssh'd in or they can be scp'ing, maybe even using an app like WinSCP. And I only care about the umask being set for these specific directories/files.
That led me to
setfacl. I've used it before in the Linux world, but this is my first time attempting it in FreeBSD+ZFS.My understanding is that I can simply run:
setfacl -R -a g:developers:rwxpaARWcs:fd:allow /usr/local/www/website/public_htmlThis does work, but it applies the same set of permissions to both directories and files. I don't want "x" or execute on files. I cannot find anywhere that explains if this is even possible.
Code:
[~]# getfacl /usr/local/www/website/public_html/test/randomfile546
# file: /usr/local/www/website/public_html/test/randomfile546
# owner: root
# group: wheel
group:developers:rwxp--aARWc--s:------I:allow
owner@:rw-p--aARWcCos:-------:allow
group@:r-----a-R-c--s:-------:allow
everyone@:r-----a-R-c--s:-------:allow
I have seen these discussions already:
https://forums.freebsd.org/threads/...not-working-being-updated-with-setfacl.82298/
https://forums.freebsd.org/threads/trouble-with-acls-setfacl.77121/
https://forums.freebsd.org/threads/do-correct-order-for-nfsv4-acl-with-setfacl-in-scripts.96444/
http://bsdwiki.reedmedia.net/wiki/View_and_modify_ACLs.html
If you can offer any help, it would be much appreciated.