chmod 777
rwxrwxrwxDangerous — avoid on real systems
Everyone can read, write and execute.
777 is the most permissive mode there is: owner, group and every other user on the system can read, modify, delete and execute the file, or create and remove anything inside the directory.
It's often suggested as a quick fix for 'Permission denied', and it does make the error go away — by removing all protection. The real problem is almost always ownership, which chown fixes properly.
Permission by permission
| Who | Read | Write | Execute | Digit | Means |
|---|---|---|---|---|---|
| owner | ✓ | ✓ | ✓ | 7 | read, write and execute |
| group | ✓ | ✓ | ✓ | 7 | read, write and execute |
| others | ✓ | ✓ | ✓ | 7 | read, write and execute |
- In
ls -l:-rwxrwxrwxfor a file,drwxrwxrwxfor a directory. - Symbolic form:
u=rwx,g=rwx,o=rwx - New directories get this mode when the umask is
000.
Use it for
- Almost nothing permanent. At most, a brief local experiment to confirm a problem is permissions-related — then revert.
- Shared scratch directories should be
1777(sticky), not 777, so users can't delete each other's files.
Avoid it for
- Web roots and upload folders: any process — including a compromised plugin — can plant or alter executable code. Use
755/644with the right owner instead. - Anything on a multi-user or internet-facing server.
- SSH directories and keys — OpenSSH refuses to use keys with permissions this open.
Commands
chmod 777 path
set this mode on a file or directory
chmod u=rwx,g=rwx,o=rwx path
the same, written symbolically
find path -type d -exec chmod 777 {} +apply it to every directory in a tree, leaving the files alone
stat -c '%a %A %n' path
check the current mode on Linux (macOS: stat -f '%Lp %Sp %N' path)
Try variations
| Who | read | write | execute | Digit |
|---|---|---|---|---|
| owner | 7 | |||
| group | 7 | |||
| others | 7 |
The owner can read, write and execute; the group can read, write and execute; everyone else can read, write and execute.
chmod 777 file
chmod u=rwx,g=rwx,o=rwx file
Frequently asked questions
Is chmod 777 safe?
No. Every user and every process on the machine can modify or replace the file. On a web server, that turns any small compromise into full control of your site.
Why does chmod 777 fix my 'Permission denied' error?
Because it grants everything to everyone. The usual real cause is that the process runs as a different user than the file's owner. Fix it with chown (for example chown -R www-data: /var/www/app) and keep 755/644.
What should I use instead of 777?
755 for directories and 644 for files is the standard. If several users need to write, put them in a shared group and use 775 and 664, with setgid on the directory (2775).