chmod 776
chmod 776 is rwxrwxrw-.
What 776 grants
| Who | Digit | Permissions | Adds up as |
|---|---|---|---|
| Owner | 7 | read, write, execute | 4 + 2 + 1 = 7 |
| Group | 7 | read, write, execute | 4 + 2 + 1 = 7 |
| Others | 6 | read, write | 4 + 2 = 6 |
When 776 is the right answer
Owner and group full, others read and write but not execute. On a directory this is a strange half-measure: others can create and delete entries but cannot traverse into subdirectories.
The command
chmod 776 filename
chmod -R 776 directory/
Because the owner has the execute bit, this works on a directory as well as a file — on a directory, execute is what grants the right to enter it and reach the entries inside.
How it is written elsewhere
| Octal | 776 |
| Symbolic | rwxrwxrw- |
As a file in ls -l | -rwxrwxrw- |
As a directory in ls -l | drwxrwxrw- |
| Binary | 111 111 110 |
| World-writable | Yes — any user on the system can modify this |
Frequently asked questions
What does chmod 776 mean?
chmod 776 sets owner to read, write, execute, group to read, write, execute, others to read, write. In symbolic notation that is rwxrwxrw-.
How do I apply 776?
Run chmod 776 filename. Add -R to apply it to a directory and everything inside, though be careful: a recursive numeric chmod marks every file the same way, which is rarely correct for a mixed tree of files and directories.
Is 776 safe?
chmod 776 is world-writable, so any account on the system can modify the contents. That is only appropriate for a shared scratch area, and even then the sticky bit should normally be set as well. For anything else, grant access through a group instead.
What is 776 in symbolic notation?
rwxrwxrw-. Written as ls -l shows it, with a leading file-type character, an ordinary file would appear as -rwxrwxrw- and a directory as drwxrwxrw-.
Other permission values
- chmod 777 — rwxrwxrwx
- chmod 1777 — rwxrwxrwt
- chmod 2755 — rwxr-sr-x
- chmod 2775 — rwxrwsr-x
- chmod 4755 — rwsr-xr-x
- chmod 4711 — rws--x--x
- chmod 6755 — rwsr-sr-x
- chmod 000 — ---------
- chmod 400 — r--------
- chmod 440 — r--r-----
- chmod 444 — r--r--r--
- chmod 600 — rw-------
- chmod 640 — rw-r-----
- chmod 644 — rw-r--r--