What does SGID do on files versus directories?
IntermediateConceptPermissions, Users & sudo
Answer
On an executable, SGID (2000) runs it with the file's group. On a directory, new files inherit the directory's group instead of the creator's primary group, which is perfect for shared team folders.
sudo chgrp devops /srv/shared
sudo chmod 2775 /srv/shared # drwxrwsr-x
More on Permissions, Users & sudo
Explain the rwx permission model for files and directories.BeginnerHow does octal notation work in chmod?BeginnerWhat does chown do and who can run it?IntermediateWhat is umask and how is the final permission calculated?IntermediateWhat is SUID and give a real example?IntermediateWhat does a capital S or T in `ls -l` output mean?Intermediate