Group write access for newly created files/directories without changing umask
I have several directories, each owned by root and a group of the same name, like this:
By setting the sgid bit, I made sure that newly created files and directories are owned by the correct group, and that directories have the sgid bit set too.
Here goes my problem:
On each newly created directory or file, the permissions are set to 755. This is because this is the default umask, and I cannot change a users umask. I actually only want files created below a particular directory to have group write access, inheriting this behaviour to newly created directories properly.
I'm not on samba or NFS, I have to do this for SSH users.
The filesystem is ext3.
I started to fool around with ACLs, but couldn't find what I was looking for.
What do you think?
And what is purpose of those group-writable files ?
It is up to the user creating a file to change the group write attribute.
You can use setfacl and create a default acl for the directory allowing write access for the group.
setfacl -m d:g:group1:rwx group1
Now a new file created in the group1/ directory will inherit the default group acl.
Now I know that the "default" actually does something :)
|All times are GMT -5. The time now is 01:36 AM.|