CHMOD Calculator
- Home
- > Utility >
- CHMOD Calculator
Quick Presets
Permission Bits
| Read (r=4) | Write (w=2) | Execute (x=1) | Octal | |
|---|---|---|---|---|
| Owner (u) | 0 | |||
| Group (g) | 0 | |||
| Other (o) | 0 |
----------
Commands
What is chmod?
In Unix/Linux, chmod changes the access permissions of a file or directory. Permissions are split into three groups: Owner, Group, and Other.
Each group has three bits: Read (4), Write (2), Execute (1). The octal digit for each group is the sum of active bits.
| Octal | Permission string | Typical use |
|---|---|---|
| 777 | rwxrwxrwx | Full access (avoid on production) |
| 755 | rwxr-xr-x | Executables, public directories |
| 644 | rw-r--r-- | Regular files (HTML, config) |
| 600 | rw------- | Private keys, sensitive files |
| 400 | r-------- | Read-only files |
How to Use This CHMOD Calculator
This calculator helps you build the correct chmod command by toggling permission bits visually. Follow these steps:
- Choose a preset — Click one of the quick preset buttons (e.g., 755, 644) to set common permission combinations instantly.
- Toggle individual bits — Click any Read, Write, or Execute checkbox under Owner, Group, or Other to fine-tune permissions.
- Type octal directly — Enter a 3-digit octal value (e.g., 750) in the input field to auto-set all checkboxes at once.
- Select flags — Choose Verbose (-v), Changes (-c), or Silent (-f) flags, and toggle Recursive (-R) for directory operations.
- Copy the command — Use the copy buttons next to the octal or symbolic command to paste it into your terminal.
Tip: Replace <file-name> in the generated command with the actual file or directory path when running it in your terminal.
Frequently Asked Questions
What does chmod 777 mean?
Chmod 777 grants read, write, and execute permissions to Owner, Group, and Other — everyone has full access. While convenient, it is considered insecure for production environments because any user on the system can modify or execute the file.
What is the difference between chmod and chown?
chmod changes the permission bits (read, write, execute) of a file or directory. chown changes the owner and group ownership of a file. They serve different purposes: chmod controls how a file can be accessed, while chown controls who owns it.
Can I use chmod on directories?
Yes. When applying chmod to a directory, the execute bit (x) allows users to enter the directory and access its contents. Use the -R (recursive) flag to apply permissions to all files and subdirectories inside a directory, but be careful — recursive changes can have widespread effects.
What is the safest chmod for a web server?
For most web server configurations, 644 for files (owner can read/write, everyone else can read) and 755 for directories (owner can read/write/execute, everyone else can read/execute) are considered safe defaults. Sensitive files like private keys or configuration files with passwords should use 600 or 400.
Why can't I change permissions even though I own the file?
You may not have permission to use chmod if the filesystem is mounted with read-only or no-execute restrictions, or if you are not the file owner (only the owner and root can change permissions). Use ls -l to verify the current owner and permissions.
What is the difference between symbolic and octal mode?
Octal mode uses a 3-digit number like 755 where each digit represents the sum of read (4), write (2), and execute (1) for Owner, Group, and Other. Symbolic mode uses letters like u+rwx,g+rx,o+rx to explicitly add or remove permissions. Both achieve the same result, but octal is more compact while symbolic is more readable for small changes.