Linux file permissions
chmod 660 meaning
The owner and the group can read and write; everyone else can do nothing.
When to use 660
Files shared with your group that others must not read, such as a group-readable database socket or log.
What each digit allows
Read = 4, write = 2, execute = 1. Each digit is the sum for one group of users.
| Who | Digit | Symbolic | Read | Write | Execute |
|---|---|---|---|---|---|
| Owner (u) | 6 | rw- | Yes | Yes | No |
| Group (g) | 6 | rw- | Yes | Yes | No |
| Others (o) | 0 | --- | No | No | No |
On a folder, read lists its contents, write adds or deletes files in it, and execute lets you open it (cd into it).
Commands
One file or folder, a folder with everything inside it, or only the files inside a folder:
chmod 660 file.php
chmod -R 660 folder/
find folder/ -type f -exec chmod 660 {} +
In cPanel: File Manager → right-click → Change Permissions, and tick the boxes until the number shows 660.
Try other permissions
Tick or untick the boxes to see the number, the symbolic form and the command.
| Read | Write | Execute | |
|---|---|---|---|
| Owner | |||
| Group | |||
| Everyone else |
Special bits (setuid, setgid, sticky)
Common values
Symbolic