In Linux when I create a directory mkdir newdir
then the newly created directory has these permissions and ownership: drwxr-xr-x 2 owner group
My Question
How can I make the default permissions for newly created DIRECTORIES be: drwxrwxrwx 2 owner group
regardless of who created the directory?
Some research I made
I know that from within a Samba share you can enforce that with directory mask
but what if someone goes to the terminal and makes a directory as root and then a regular user comes along and he then won't be able to create files in that directory that the root user made?
I have been playing with ACLs and I understand how to make all newly created FILES have certain permissions.
e.g: setfacl -dRm u::rwX,g::rwX,o::0 newdir/
This makes all files in the newdir
folder have permission: -rw-rw----
regardless of who created the file.
I also learnt about "setting the directory group id bit" so that any files (or directories) created in the "newdir" directory will have group ownership equal to the group ownership of the "newdir" directory.
chmod g+s newdir/
I have not been able to find out how to make the default permissions for a newly created DIRECTORY be: drwxrwxrwx 2 owner group
regardless of who ever created the directory? Maybe it's something to do with umask? Can it be done with ACLs?