chmod 775 — what does it mean?
775 is 755 with write for the group, which makes it the standard mode for a directory a team works in together: everyone in the group can create, rename and delete files, while other users can still browse. It is also what new directories get on systems that give users umask 002, such as many distributions that create a private group per user. On its own, 775 has a catch: files created inside belong to the creator's primary group, so you usually want the setgid version, 2775.
775
rwxrwxr-x
The owner and members of the file's group can read, write and execute; all other users can read and execute but not modify.
Symbolic equivalent: chmod u=rwx,g=rwx,o=rx /srv/shared
What each digit in 775 means
Each octal digit is the sum of read (4), write (2) and execute (1) for one class of users. The digits are, in order, the file's owner, the file's group, and everyone else.
| Class | Digit | Sum | r w x | ls -l |
|---|---|---|---|---|
| Owner (u) | 7 | 4 + 2 + 1 | rwx | rwx |
| Group (g) | 7 | 4 + 2 + 1 | rwx | rwx |
| Others (o) | 5 | 4 + 0 + 1 | r-x | r-x |
- Owner: can list the names of entries, create, rename and delete entries and enter the directory and open files by name.
- Group: can list the names of entries, create, rename and delete entries and enter the directory and open files by name.
- Others: can list the names of entries and enter the directory and open files by name; no write.
When to use chmod 775
- Shared project or deployment directories owned by a team group, e.g. /srv/shared owned by root:devs.
- Upload or cache directories the web server writes to through its group (owner deploy, group www-data), instead of 777.
- Group-maintained scripts in a shared bin directory, where any team member may update them.
- Combined with setgid as 2775 so new files inherit the directory's group.
Security risks and gotchas
Everyone in the group can delete everything
Write on a directory lets a group member delete or replace any file in it, including files owned by other members. Keep the group small, or add the sticky bit (3775) so members can only delete their own files.
sshd rejects group-writable home and .ssh
Never apply 775 to a home directory or ~/.ssh if you log in with keys: StrictModes treats a group-writable path as unsafe and falls back to password authentication or refuses login.
GNU chmod keeps setgid on directories
On Linux, chmod 775 on a directory that is already 2775 leaves the setgid bit in place; coreutils preserves a directory's set-user-ID and set-group-ID bits for numeric modes. Use chmod g-s or 00775 to clear it.
Commands
Make a directory group-writable
chmod 775 /srv/sharedEquivalent to chmod ug=rwx,o=rx /srv/shared.
Proper shared team directory
sudo chgrp devs /srv/shared
sudo chmod 2775 /srv/sharedThe 2 is setgid: files and subdirectories created inside get the devs group automatically. Pair with umask 002 so new files are 664.
Apply to an existing tree
find /srv/shared -type d -exec chmod 2775 {} +
find /srv/shared -type f -exec chmod 664 {} +Directories 2775, files 664. Re-add execute to real scripts with chmod g+x.
How to check for 775
# Symbolic view
ls -ld /srv/shared
drwxrwxr-x 2 deploy devs 4096 Oct 16 09:12 /srv/shared
# Octal view (Linux / GNU coreutils)
stat -c '%a %A %n' /srv/shared
775 drwxrwxr-x /srv/shared
# Octal view (macOS / BSD)
stat -f '%Lp %Sp %N' /srv/sharedThe first character of the ls -l output is the file type (- regular file, d directory), followed by the nine permission characters. stat -c %a prints the octal mode directly; it only shows a fourth leading digit when setuid, setgid or the sticky bit is set.
Related chmod modes
755rwxr-xr-x
Owner full access, everyone else read and execute
664rw-rw-r--
Owner and group read and write, others read-only
777rwxrwxrwx
Everyone can read, write and execute
750rwxr-x---
Owner full access, group read and execute, others none
Try variations of 775 in the chmod calculator, browse all chmod modes, or read Linux file permissions explained for chown, umask and ACLs.
Frequently Asked Questions
When should I use 775 instead of 755?▾
When members of the file's group need to create or modify files in that directory. If only the owner ever writes, 755 is tighter and enough.
Is chmod 775 secure?▾
It is secure as long as you trust everyone in the group, because they all get full write access. Other users can still read and list. Prefer 775 with a dedicated group over 777, which gives write to everyone.
What is chmod 2775?▾
775 plus the setgid bit. On a directory, setgid makes new files and subdirectories inherit the directory's group instead of the creator's primary group, so a shared folder stays owned by the team group. ls -l shows it as drwxrwsr-x.