Check or uncheck Read (4), Write (2), and Execute (1) bits for Owner, Group, and Public—plus Setuid, Setgid, and Sticky flags—or type any octal (600, 644, 755, 1777) or symbolic (-rwxr-xr-x) string to generate exact chmod commands.
One careless chmod -R 777 on a Linux server or Docker image compromises SSH keys, opens privilege escalation paths, and causes sshd to refuse private keys outright. Yet translating mental octal math during an incident deploy is surprisingly error-prone.
This bidirectional POSIX permissions matrix keeps checkboxes, 3-digit and 4-digit octal numbers, ls -l symbolic notation (including lowercase s/t vs uppercase S/T special bits), and ready-to-paste chmod commands synchronized in real time.
Linux Permission Mistakes in Servers & Containers
01. Reaching for chmod 777 to Fix "Permission Denied"
Making files world-writable allows any compromised service account on the host to overwrite scripts or web roots. Fix file ownership (chown) or use 755 for executables and 644 for static files instead.
02. Loose Permissions on SSH Private Keys (~/.ssh/id_ed25519)
OpenSSH refuses to load private keys readable by group or other ("UNPROTECTED PRIVATE KEY FILE"). Private keys require 600 (-rw-------) and ~/.ssh itself requires 700 (drwx------).
03. Directory Execute (x) Bit Is Required to Traverse
Unlike regular files, a directory needs the execute (x) bit to cd into it or access files inside by name. Running chmod -R 644 on a folder strips directory x bits and locks out web servers—use capital X (chmod -R u=rwX,go=rX) instead.
Standard Production Chmod Presets
| Octal Mode | Symbolic (ls -l) | Standard Production Use |
|---|---|---|
| 600 | -rw------- | SSH private keys, .env secrets, TLS private certs |
| 644 | -rw-r--r-- | Web assets, Nginx configs, source code files |
| 700 | -rwx------ | ~/.ssh directory, private backup scripts |
| 755 | -rwxr-xr-x | Executable scripts, CLI binaries, public directories |
| 1777 | -rwxrwxrwt | Shared /tmp directory with sticky bit (delete own only) |
| 2775 | -rwxrwsr-x | Shared team directory with setgid inheriting group ID |
Worked Engineering Examples
Locking Down a Production .env Secret File
Owner: Read + Write · Group: None · Public: None
Octal: 600 (0600) · Symbolic: -rw------- · Command: chmod 600 .env
Only the service owner account can read or modify database passwords and API keys.
Interpreting Uppercase S vs Lowercase s (Setuid)
Octal: 4644 vs 4755
4644 -> -rwSr--r-- (setuid without owner x) · 4755 -> -rwsr-xr-x (setuid + owner x)
Lowercase s indicates the underlying execute bit is also set; uppercase S warns that execute is off.
Frequently Asked Questions
How is each octal digit in chmod calculated?
Each of the three positions (Owner, Group, Public) sums Read = 4, Write = 2, and Execute = 1. For example, rwx = 4+2+1 = 7, r-x = 4+0+1 = 5, and r-- = 4+0+0 = 4.
What does the optional leading 4th octal digit control?
The leading digit controls special POSIX bits: 4 = Setuid (run as file owner), 2 = Setgid (inherit directory group or run as group), and 1 = Sticky bit (restricts deletion in shared folders like /tmp to file owners).
Can I paste an `ls -l` string like `-rw-r--r--` directly into the input?
Yes. Both 9-character (rwxr-xr-x) and 10-character (-rwxr-xr-x or drwxr-xr-x) symbolic strings parse directly into the interactive matrix.
Why does the calculator show a red warning on 777 or 666?
World-writable permissions without a sticky bit expose scripts and config files to tampering by any local process or user, which violates least-privilege security baselines.