How to work out chmod permissions
- Tick Read, Write and Execute for the owner, the group and everyone else, or click a preset such as 644 or 755.
- To go the other way, type a number like 750 into Numeric, or letters like rwxr-x--- or a change like u+x into Symbolic, and the boxes update to match. Add setuid, setgid or the sticky bit if you need them.
- Type your file or folder name, tick Whole folder (-R) to include everything inside, and press Copy command.
Common permission modes
| Mode | Symbolic | Use it for |
|---|---|---|
| 644 | rw-r–r– | Ordinary files: web pages, images, config files others may read |
| 755 | rwxr-xr-x | Folders, scripts and programs everyone can run |
| 600 | rw—–– | Private files, like SSH private keys and files with passwords |
| 700 | rwx—— | Private folders, like ~/.ssh, and scripts only you run |
| 400 | r–––– | Files you never want to change by accident, like a downloaded key |
| 777 | rwxrwxrwx | Almost never. See below |
Run ls -l to see the current permissions of files in a folder. The first column shows the symbolic form, with a leading d for folders. Add -R to chmod to change a folder and everything inside it, but be careful: files and folders usually need different modes.
Why 777 is risky
777 lets every user and every process on the machine change, replace or delete the file. On a shared server or a web host, that means any other account, or any script that gets compromised, can write its own code into your files and have it run.
When something fails with “permission denied”, the real fix is usually the owner, not the mode. Use chown to give the file to the user that needs it, such as the web server’s user, and keep 644 for files and 755 for folders. Avoid chmod -R 777 even as a quick test, because it’s easy to forget to undo.