Linux – setgid and group write – possible for recursive directories

chmodlinuxpermissionssetgidunix

I'd like to set the gid bit so the child files/folders will be set to a specific group. But I noticed that the permissions for group are only set to read and execute, not write – by default at least. Is it possible to set it to ensure that the group always has (by default, unless explicitly changed of course), has write access to all children?

Thanks

Best Answer

The setgid bit controls the group that sub-ordination files/directories will have. If you want permissions set you will need to adjust the umask. A pretty common configuration is 022 which masks away the write access for both the group/other privileges. You probably want a umask of 002. Do a search on this site for umask to see how to set it. Some applications like sftp will need tweaks make in the right place.

Related Topic