Setting Default Permissions
Ok, for point 1, the solution is quite easy:
chgrp developers /opt/dev
For points 2 and 3, I suppose you'll need ACL
. So, the first thing to do is to edit /etc/fstab
to give the option acl
to the mountpoint of /opt/dev
. If /opt/dev
is not on a separate partition you'll need to enable ACL
for the whole root filesystem.
Then you'll have to follow this answer.
chmod g+s /opt/dev
should be equivalent to chgrp developers /opt/dev
(and doesn't set the sticky
bit, s
sets the suid
bit).
Then proceed with setfacl
:
setfacl -d -m g::rwx /opt/dev //set group to rwx default
setfacl -d -m o::rx /opt/dev //set other
to set advanced permission criteria for files and directories. To be honest, I couldn't find a way to set separate file and directory permissions, but I'm pretty sure it's doable. You can try this tutorial to have more information about the topic.