2. Set Group ID (SGID)
- Octal: 2
- Symbolic:
sin the Group field.
On a File: When executed, the process runs with the permissions of the file's group owner.
On a Directory: This is very important for shared directories. Any file or directory created within an SGID-enabled directory automatically inherits the group ownership of the parent directory, regardless of the user who created it. This ensures all new content belongs to the shared group.
3. The Sticky Bit
- Octal: 1
- Symbolic:
tin the Others field.
The Sticky Bit is primarily used on directories. If set, users can create files in that directory, but they can only delete files that they own (even if they have write permission for the directory).
Crucial Example: The /tmp directory. It is world-writable, but the Sticky Bit prevents users from deleting files created by others.
bash $ ls -ld /tmp drwxrwxrwt 13 root root ... /tmp