Understanding the 2775 Permission Set
The octal mode 2775 is the go‑to for giving a directory shared write access while keeping new files in the same group.
- 2 – set‑gid bit: new files inherit the directory’s group.
- 7 – owner gets
rwx. - 7 – group gets
rwx. - 5 – others get
r-x.
On a path like /srv/shared it looks tidy: any member of the group can drop files, and those files stay in the same group for later collaboration. The flip side? Group write is a double‑edged sword. If the group contains people you don’t fully trust, or if the directory is exposed to a wider audience, the set‑gid bit can become a vector for privilege escalation or accidental data exposure.