What does chmod 775 mean? Shared folder permissions for a team

By TechCompare · Updated · How we check

chmod 775 sets permissions to rwxrwxr-x, which gives the folder's group write access. Use it for a team folder, but only after you've checked who is in the group.

775 is the mode for a folder that a team has to write to. In ls -l it shows as drwxrwxr-x, and the owner and group both get write access while everyone else can only read and enter. Every member of the group can create files there and delete any file in the folder, so the group matters as much as the mode.

Octal
775
chmod 775
Symbolic
rwxrwxr-x
Owner / Group / Others
Category
Group Access
Shared with one group

How this is calculated

In octal, the owner's digit is 7, read, write and execute. The group digit is 7, so the group gets read, write and execute too. Others get 5, made from 4+1, so they can read and enter but not write.

The mode alone doesn't make a team folder. Pick a group with only the people who need access, then point the folder at it. Here's a setup with made-up names: the folder is /srv/project and the group is developers. chgrp developers /srv/project sets the group, chmod 775 /srv/project sets the mode, and chmod g+s /srv/project makes new files get the folder's group instead of the creator's.

Compared with 777, others lose write access. They can still read and enter, so see the chmod 777 page for why full write access is risky.

Verdict

The group is the real access list. groups username shows the groups one user belongs to, so run it for each person on the team and for anyone who shouldn't have access. If someone who shouldn't write there is in the group, make a smaller group.

The folder's mode doesn't set the mode of the files inside. A new file takes its mode from the umask, and with umask 022, which many Linux systems use by default, that's 644, so the group can't write to it. Run umask 002 in each teammate's shell or profile, and new files come out as 664, which the group can write. Files that already exist need chmod g+w on them. New subfolders follow the umask too, so at 022 a new folder is 755, and the group can't add files to it.

Skip 775 for a folder that holds secrets, or where the group is large or unclear, since every member can write to the folder. A web root that nobody else should write to belongs at 755, or 750 if a group needs to read it.

More CHMOD scenarios

Frequently asked questions

What does chmod 775 mean?
The owner and the group can read, write and enter the folder, and everyone else can read and enter it. Removing a file depends on write permission on its folder, so any group member can remove any file in it, unless the folder has the sticky bit set.
What's the difference between chmod 755 and 775?
Only the group digit changes. In 755 it's 5, which is read and execute. In 775 it's 7, which adds write. So with 755 only the owner can add files to the folder, and with 775 the group can too.
Why can't my teammates edit the files in a 775 folder?
The folder's mode doesn't set the mode of its files. A new file takes its mode from the umask, and at umask 022 that's 644, so the group can only read it. Set umask 002 for each teammate and new files come out as 664, or run chmod g+w on the files.
Is chmod 775 safe for a web directory?
It depends on who's in the group. Anyone in the group can write to the folder, and a web server that runs as a member of that group can too. If only one account writes to the directory, chmod 755 is enough, since the web server only needs read and enter. Use 775 only when the group is a set of people you trust with write access.