Owner can read, write and execute. Group can read, write and execute. Others can read, write and execute.
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | ✓ |
| Group | ✓ | ✓ | ✓ |
| Others | ✓ | ✓ | ✓ |
Typical use
Everyone can do everything: avoid it outside throwaway tests.
Good to know
777 (rwxrwxrwx) lets every user on the system read, change, replace and run the file, or create and delete anything in a folder. It is usually set as a quick fix for “Permission denied” and hides the real problem, wrong ownership or a missing group. Any local user or compromised process, such as a hacked PHP plugin, can then inject code into your files.
Fix the cause instead: give the folder to the user that writes to it (chown www-data uploads) or use a shared group with 775 and setgid. Some software refuses world-writable files on purpose: sshd ignores such authorized_keys files, and cron skips writable files in /etc/cron.d. A shared temp folder that really needs it should use 1777, with the sticky bit, like /tmp.
Commands
| Set the mode | chmod 777 file |
|---|---|
| The same with letters | chmod u=rwx,g=rwx,o=rwx file |
| A folder and everything in it | chmod -R 777 folder |
| Only the folders inside | find folder -type d -exec chmod 777 {} + |
| How ls -l shows it | -rwxrwxrwx |