Chmod 2700 Explained
Chmod 2700: SGID with owner-only access. New subdirectories and files inherit the group even in a private directory.
Permission
2700
rwx--S---
chmod 2700 filename
Permission Breakdown
| Role | Read (4) | Write (2) | Execute (1) | Octal | Meaning |
|---|---|---|---|---|---|
| Owner | r | w | x | 7 | read, write, execute |
| Group | - | - | - | 0 | no permissions |
| Others | - | - | - | 0 | no permissions |
Visual Permission Grid
Detailed Explanation
The permission 2700 sets the SGID bit on a directory where only the owner has access.
Octal breakdown:
- 2 (Special): SGID bit set
- 7 (Owner): read (4) + write (2) + execute (1) = full access
- 0 (Group): no access
- 0 (Others): no access
In symbolic notation this is rwx--S---. The uppercase S indicates that SGID is set but the group execute bit is not set.
Even though only the owner can access this directory, the SGID bit ensures that files and subdirectories created within it inherit the directory's group ownership. This is useful when the owner works across multiple primary groups and wants to ensure consistent group assignment for all files in a particular directory tree.
Use Case
Used when an administrator manages files across multiple groups and wants to ensure that all files in a directory tree maintain a specific group ownership, even before the directory is shared.