Chmod 2775 Explained
Chmod 2775: SGID with full owner and group access plus public read. New files inherit the group. Ideal for collaborative web directories.
Permission
2775
rwxrwsr-x
chmod 2775 filename
Permission Breakdown
| Role | Read (4) | Write (2) | Execute (1) | Octal | Meaning |
|---|---|---|---|---|---|
| Owner | r | w | x | 7 | read, write, execute |
| Group | r | w | x | 7 | read, write, execute |
| Others | r | - | x | 5 | read, execute |
Visual Permission Grid
Detailed Explanation
The permission 2775 combines 775 permissions with the SGID bit, creating a collaborative directory with consistent group ownership.
Octal breakdown:
- 2 (Special): SGID bit set
- 7 (Owner): read (4) + write (2) + execute (1) = full access
- 7 (Group): read (4) + write (2) + execute (1) = full access
- 5 (Others): read (4) + execute (1) = read and execute
In symbolic notation this is rwxrwsr-x. The s in the group execute position indicates SGID. The owner and group have full access. Others can read and traverse.
The SGID bit ensures that all new files created inside this directory inherit the directory's group ownership. This is essential for collaborative workflows: when developer A creates a file, it is automatically owned by the project group (not A's primary group), so developer B can immediately edit it. Without SGID, files would be owned by each user's primary group, potentially causing permission issues.
Use Case
Standard permission for collaborative web directories (/var/www/project) and shared development workspaces where consistent group ownership is required.