What chmod 770 means
| Who | Digit | Letters | On a file | On a directory |
|---|---|---|---|---|
| owner | 7 |
rwx |
Can read, modify and run | Can list files, create, delete and rename files and enter it and open files |
| group | 7 |
rwx |
Can read, modify and run | Can list files, create, delete and rename files and enter it and open files |
| others | 0 |
--- |
No access | No access |
Each digit is the sum of read (4), write (2) and execute (1). In
ls -l output it looks like this:
$ ls -l
drwxrwx--- 2 alice staff 4096 Oct 21 10:30 example-dir
- The owner can read, write and execute.
- The group can read, write and execute.
- Everyone else can do nothing.
When to use 770
- Private team directories
- Application data shared by a service and its admins
770 is the private version of 775: the owner and group can do everything, and other users can’t even list the directory. It is a good default for data that a service account and an admin group both manage, such as /var/lib/myapp.
770 is also the default mode for new directories, with umask 007.
Is chmod 770 safe?
Yes. Nobody outside the owner and group can access it at all (except root).
Commands
# One file or directory
chmod 770 path
# Same thing in symbolic form
chmod u=rwx,g=rwx,o= path
# Every directory under a tree (leaves files alone)
find /path/to/dir -type d -exec chmod 770 {} +
# Check the result
stat -c '%a %A %n' path # Linux
stat -f '%Lp %Sp %N' path # macOS
Avoid chmod -R 770 on a whole tree: it gives files and directories the same mode. The
find form above changes only directories.
Compare with similar modes
| Mode | Symbolic | Difference |
|---|---|---|
777 |
rwxrwxrwx |
Gives everyone full read, write and execute access |
775 |
rwxrwxr-x |
Gives the owner and group full access, and others read and execute |
750 |
rwxr-x--- |
Gives the owner full access, the group read and execute, and others nothing |
700 |
rwx------ |
Gives the owner full access and everyone else nothing |
Other chmod values
777 · 775 · 755 · 751 · 750 · 744 · 711 · 700 · 666 · 664 · 660 · 644 · 640 · 600 · 555 · 500 · 444 · 400 · 000 · 1777 · 2775 · 4755
Need a different combination? Use the Chmod Calculator.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does chmod 770 mean?
chmod 770 sets the permissions to rwxrwx---. The owner can read, write and execute. The group can read, write and execute. Everyone else can do nothing.
Is chmod 770 safe?
Yes. Nobody outside the owner and group can access it at all (except root).