Linux File Permission Reference
Understanding Unix permissions prevents security holes and broken deployments. Here's what you need to know.
How octal works
Each digit (0–7) represents one entity's permissions. r=4, w=2, x=1 — add them up. So 6 = read+write, 5 = read+execute, 7 = all three.
755 vs 644
755 — owner can read/write/execute; group and others can read/execute. Use for web directories and shell scripts. 644 — owner read/write; everyone else read-only. Use for static web files.
Never use 777
chmod 777 lets anyone on the server read, write, and execute the file. This is a critical security risk on shared hosts and any server exposed to the web.
Recursive flag -R
Use chmod -R 755 /path/dir to apply permissions to a directory and all its contents. Toggle the -R checkbox above to include it in the generated command.
SSH / private keys
SSH requires your private key to be 600 (owner read/write only). If permissions are too open, SSH will refuse to use the key entirely.
Symbolic notation
The 9-character string like rwxr-xr-x is what you see in ls -la. First 3 = owner, middle 3 = group, last 3 = others. A dash (-) means that permission is off.