chmod 777
chmod 777 is rwxrwxrwx.
What 777 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 | 7 | read, write, execute | 4 + 2 + 1 = 7 |
When 777 is the right answer
Everyone can do everything. It resolves almost any permission error, which is why it gets suggested so often, and it does so by removing the protection rather than fixing the cause. The real fix is nearly always to change the owner or group so that the process needing access already has it.
The command
chmod 777 filename
chmod -R 777 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 | 777 |
| Symbolic | rwxrwxrwx |
As a file in ls -l | -rwxrwxrwx |
As a directory in ls -l | drwxrwxrwx |
| Binary | 111 111 111 |
| World-writable | Yes — any user on the system can modify this |
Frequently asked questions
What does chmod 777 mean?
It sets owner to read, write, execute, group to read, write, execute, others to read, write, execute. In symbolic notation that is rwxrwxrwx.
How do I apply 777?
Run chmod 777 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 777 safe?
It 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 777 in symbolic notation?
rwxrwxrwx. Written as ls -l shows it, with a leading file-type character, an ordinary file would appear as -rwxrwxrwx and a directory as drwxrwxrwx.