$ man chmod

chmod

Linux File Permissions Calculator

Owner
(u) user
Group
(g) group
Other
(o) world
setuid
4000
Run as file owner
setgid
2000
Run as file group
sticky
1000
Only owner can delete
Octal
0special
·
6owner
·
4group
·
4other
Symbolic String
chmod (octal)
chmod (symbolic)
ls -la output preview
OctalSymbolicTypical Use Case
400r--------Read-only by owner — private key files (e.g. ~/.ssh/id_rsa)
444r--r--r--Read-only by everyone — public static assets
600rw-------Read/write owner only — config files with secrets
644rw-r--r--Default web file — HTML, CSS, JS, images
664rw-rw-r--Shared project files — group can edit
666rw-rw-rw-Read/write by all — temp files (avoid on web servers)
700rwx------Private executable — owner-only scripts
711rwx--x--xExecute by all, write/read by owner only
755rwxr-xr-xDefault directory / public executable — system binaries
775rwxrwxr-xShared directory — group can write
777rwxrwxrwxWorld-writable — dangerous, avoid in production
1777rwxrwxrwtSticky bit — /tmp style shared directory
2755rwxr-sr-xsetgid directory — new files inherit group
4755rwsr-xr-xsetuid binary — runs as owner (e.g. /usr/bin/passwd)
Action Owner (u) Group (g) Other (o)
Read file contents
Write / modify file
Execute / traverse dir