Interview Prep/Linux/Permissions, Users & sudo

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
All Linux questions Roadmap: Linux

More on Permissions, Users & sudo