What is Chmod Calculator?
Chmod Calculator is an interactive tool for calculating and converting Unix/Linux file permissions. It helps you quickly set the right permissions using an intuitive visual interface instead of memorizing octal codes or symbolic notation.
Why Use a Chmod Calculator?
Unix file permissions control who can read, write, or execute files and directories. Getting permissions wrong can lead to security vulnerabilities or broken applications. This tool makes it easy to:
Visualize Permissions
Interactive checkbox matrix for intuitive permission management
Convert Between Formats
Seamlessly switch between octal (755), symbolic (rwxr-xr-x), and chmod commands
Generate Commands
Ready-to-use commands you can copy and paste into your terminal
Special Permissions
Handle advanced permissions like Setuid, Setgid, and Sticky Bit
Understanding Permission Basics
Every file and directory in Unix has three permission sets:
Owner (u)
Group (g)
Others (o)
How to Use Chmod Calculator
Permission Matrix
Click the checkboxes in the permission matrix to toggle Read, Write, and Execute for each role (Owner, Group, Others). The octal value, symbolic notation, and generated commands update instantly.
Octal Input
Type a 3-digit octal value (e.g., 755) or a 4-digit value with special permissions (e.g., 4755) directly into the octal input field. All checkboxes and outputs sync automatically.
Symbolic Input
Type symbolic notation (e.g., rwxr-xr-x) into the symbolic input field. Special characters like s, S, t, and T are supported for setuid, setgid, and sticky bit.
Using Presets
Click any preset button to quickly set a common permission value:
| Octal | Symbolic | Use Case |
|---|---|---|
644 |
rw-r--r-- |
Standard for regular files (owner read/write, others read) |
755 |
rwxr-xr-x |
Directories and executables (owner full, others read/execute) |
600 |
rw------- |
Private files like SSH keys (owner read/write only) |
777 |
rwxrwxrwx |
Caution Full access for everyone |
Copying Commands
The output section shows ready-to-use chmod commands in both octal and symbolic formats. Click the copy button next to any command to copy it to your clipboard, then paste it into your terminal.
Features
Interactive Permission Matrix
A visual 3x3 grid lets you toggle permissions for Owner, Group, and Others. Each column shows the numeric weight (Read=4, Write=2, Execute=1), and the per-role octal total updates as you click.
Bidirectional Sync
Change any input and everything else updates in real-time — no need to click a "Calculate" button. Edit checkboxes, type octal values, or enter symbolic notation, and all other fields stay in sync.
Special Permissions
Toggle Setuid (4), Setgid (2), and Sticky Bit (1) to generate 4-digit octal values. The symbolic notation correctly shows s/S for setuid/setgid and t/T for sticky bit.
Setuid (4)
Setgid (2)
Sticky Bit (1)
File and Directory Mode
Switch between File and Directory to see how permissions appear in ls -l output. Files show a - prefix while directories show d.
Recursive Flag
Enable the Recursive option to add -R to generated chmod commands, useful for applying permissions to directories and their contents.
chmod -R 755 /path/to/directory
Octal Breakdown
See exactly how each role's octal value is calculated. For example, Owner with read + write + execute shows 4 + 2 + 1 = 7.
Common Presets
One-click presets for frequently used permission values (644, 755, 777, 700, 600, 400, 775, 000) with descriptive tooltips explaining each use case.
Frequently Asked Questions
What is the difference between 644 and 755?
rw-r--r--
- Standard for regular files
- Owner: read and write
- Group & Others: read only
- No execute permission
rwxr-xr-x
- For directories and executables
- Owner: full access
- Group & Others: read and execute
- Execute permission enabled
When should I use 777 permissions?
Permission 777 gives full read, write, and execute access to everyone. This is generally not recommended for production environments as it poses security risks.
Safer alternatives:
- Use
775for shared directories (no write for others) - Use
755for public executables - Use
770for group-only access
What are Setuid, Setgid, and Sticky Bit?
Setuid (4)
Setgid (2)
Sticky Bit (1)
/tmp.4755 means Setuid is enabled (4) plus standard 755 permissions.What is the difference between symbolic and octal notation?
755
- Uses numbers (0-7)
- Each digit is sum of permissions
- 4 = read, 2 = write, 1 = execute
- Compact and precise
rwxr-xr-x
- Uses letters (r, w, x)
- Shows each permission explicitly
- r = read, w = write, x = execute
- More readable and intuitive
How do I apply permissions recursively?
Enable the Recursive (-R) option to generate a command like chmod -R 755 directory. This applies the same permissions to the directory and all files and subdirectories within it.
# Apply 755 to directory and all contents
chmod -R 755 /var/www/html
# Apply 644 to all files recursively
find /path/to/dir -type f -exec chmod 644 {} \;
# Apply 755 to all directories recursively
find /path/to/dir -type d -exec chmod 755 {} \;
What permission should I use for SSH keys?
SSH private keys should use 600 (rw-------) — only the owner can read and write. SSH will refuse to use keys with broader permissions for security reasons.
| File/Directory | Permission | Octal | Reason |
|---|---|---|---|
~/.ssh/ |
rwx------ |
700 | SSH directory must be private |
id_rsa |
rw------- |
600 | Private key must be owner-only |
id_rsa.pub |
rw-r--r-- |
644 | Public key can be readable |
authorized_keys |
rw------- |
600 | Controls access to server |
known_hosts |
rw-r--r-- |
644 | Can be readable by user |
# Set correct permissions for SSH directory
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
No comments yet. Be the first to comment!