I’ve known for a while that there is a way to set the default group ownership and rwx permissions of files in a directory, but I’ve been content with changing files permission levels on an as needed basis until today.
To set the default file permissions in a directory:
umask 775 /path/to/dir
To set the default group ownership:
chmod g+s /path/to/dir
Here is a good article on file permissions in linux: http://www.linuxforums.org/security/file_permissions.html
Related posts:
Your first command is incorrect:
umask 775 /path/to/dir
This will not change the default permissions for files created in the directory. The path to the directory will be ignored and this will change the default permissions for all files created during that session regardless of where they are created.