eddieleprince wrote:
Inspired by Randall Schulz contribution, I would like to ask how would you set the umask (if that is how it is done) so that newly created files/directories keep the group and privileges of the container directory and not necessarily the group of the creator? By way of example, my default group may be "admin" but I want to create files in a directory owned by group "sales". I want that file to be readable by the sales group but I do want to have to do to a chown or chgrp each time I create a file.
A directory can't be owned by a group, but you can chgrp to that group. Then set the sticky bit, so that any files created will inherit the group ID. This way, when someone creates a file, while it will still be owned by the user, it will get the group's permission. However, the permission bits will still be determined by the file creators umask. He can, however, change the permissions, if necessary.