Common Chmod Examples
Real-world permission codes and when to use each one.
| Octal | Symbolic | Typical Use Case |
|---|---|---|
| 644 | rw-r--r-- | Static web files — HTML, CSS, JS, images, config files that shouldn't run as code |
| 755 | rwxr-xr-x | Web directories, shell scripts, and CGI/PHP-CLI files that others need to execute or list |
| 600 | rw------- | SSH private keys, .env files, and other secrets only the owner should touch |
| 700 | rwx------ | Personal scripts and private directories, like ~/.ssh |
| 664 | rw-rw-r-- | Files shared for editing among a trusted team/group, read-only to the world |
| 775 | rwxrwxr-x | Shared deployment directories where a group needs full write and execute access |
| 640 | rw-r----- | Config or log files readable by a trusted group, hidden from everyone else |
| 444 | r--r--r-- | Immutable reference files nobody should be able to write to, including the owner |
| 777 | rwxrwxrwx | ⚠ Full open access — almost never appropriate on a live server; avoid in production |
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.
What does the "d" or "-" mean in ls -la?
The very first character in ls -la output shows the file type, not a permission — d means directory, - means regular file, and l means symbolic link. The nine characters after it are the actual permissions.
Why does execute (x) matter for directories?
On a directory, execute permission controls whether a user can enter it or access files inside, not "run" it. Without x, even a directory that's readable can't be traversed with cd.
chmod vs chown — what's the difference?
chmod changes what actions are allowed (read/write/execute). chown changes who owns the file (which user and group it belongs to). This calculator only covers permissions, not ownership.
Can I use symbolic mode instead of octal?
Yes — commands like chmod u+x file.sh or chmod go-w file.sh add or remove specific permissions symbolically. This tool focuses on absolute octal/symbolic values, which are easier to reason about and script.
Does this tool actually change permissions on my server?
No. It only calculates the values and generates the command text — it never connects to any server. You copy the generated command and run it yourself over SSH or in your local terminal.