Every file and directory on a Linux system has a set of permissions that controls who can read, write, or execute it. The chmod calculator helps you understand and set these permissions correctly — whether you're deploying a web application, securing sensitive files, or managing a server. This guide explains how Linux file permissions work, breaks down the octal numbering system, covers common permission patterns like 755 and 644, and shows you how to use our interactive chmod calculator to generate the exact command you need.
Calculate chmod Permissions — Free & Instant
Toggle permissions interactively, see octal and symbolic notation in real-time, and copy the ready-to-paste chmod command. No signup, no server — runs in your browser.
What Is chmod and How Do Linux File Permissions Work?
chmod (short for "change mode") is a Linux and Unix command that modifies the access permissions of files and directories. Every file in a Linux system has three types of permissions assigned to three categories of users, creating a 9-bit permission matrix that controls all file access.
The Three Permission Types
- Read (r): Permission to view the contents of a file, or list the contents of a directory. Represented by the number
4in octal notation. - Write (w): Permission to modify or delete a file, or add/remove files within a directory. Represented by the number
2in octal notation. - Execute (x): Permission to run a file as a program or script, or access (cd into) a directory. Represented by the number
1in octal notation.
The Three User Categories
- Owner (u): The user who created the file. Usually has the most permissions.
- Group (g): Users who belong to the file's assigned group. Useful for team access control.
- Others (o): Everyone else on the system who is not the owner and not in the group.
When you run ls -la in a terminal, you see permissions displayed as a 10-character string like -rwxr-xr-x. The first character indicates the file type (- for file, d for directory), followed by three groups of three characters representing owner, group, and others permissions respectively.
On Linux, even the root user respects execute permissions on files — a file without the execute bit set cannot be run as a program, regardless of who you are.
Octal Permission Numbers Explained: How 755 and 644 Work
The octal (base-8) numbering system is the most common way to express Linux permissions. Each permission type has a numeric value, and you add them together to get a single digit for each user category.
Permission Values
| Permission | Symbol | Octal Value |
|---|---|---|
| Read | r | 4 |
| Write | w | 2 |
| Execute | x | 1 |
| No permission | - | 0 |
How to Calculate
Add the values of the permissions you want to grant for each user category:
- 7 = Read (4) + Write (2) + Execute (1) = Full access (rwx)
- 6 = Read (4) + Write (2) = Read and write (rw-)
- 5 = Read (4) + Execute (1) = Read and execute (r-x)
- 4 = Read only (r--)
- 3 = Write (2) + Execute (1) = Write and execute (-wx)
- 2 = Write only (-w-)
- 1 = Execute only (--x)
- 0 = No permissions (---)
So chmod 755 means: Owner gets 7 (rwx), Group gets 5 (r-x), Others get 5 (r-x). This is the most common permission for web directories and executable scripts — the owner can do everything, while everyone else can read and execute but not modify.
Remember the formula: r=4, w=2, x=1. Just add the numbers you need. Need read+write? That's 4+2=6. Need read+execute? That's 4+1=5.
Common chmod Permission Values: Complete Reference Table
Here are the most commonly used permission combinations and when to use each one. Bookmark this table for quick reference when managing your servers.
| chmod | Symbolic | Owner | Group | Others | Common Use |
|---|---|---|---|---|---|
| 777 | rwxrwxrwx | Full | Full | Full | Temporary debug only — NEVER in production |
| 755 | rwxr-xr-x | Full | Read+Exec | Read+Exec | Web directories, executable scripts, public folders |
| 750 | rwxr-x--- | Full | Read+Exec | None | Application directories, team-shared programs |
| 700 | rwx------ | Full | None | None | Private scripts, SSH keys directory (~/.ssh) |
| 644 | rw-r--r-- | Read+Write | Read | Read | HTML, CSS, JS, images, config files |
| 640 | rw-r----- | Read+Write | Read | None | Log files, application configs with secrets |
| 600 | rw------- | Read+Write | None | None | SSH private keys, .env files, credentials |
| 555 | r-xr-xr-x | Read+Exec | Read+Exec | Read+Exec | Read-only executables, system binaries |
| 444 | r--r--r-- | Read | Read | Read | Read-only files, published documents |
| 400 | r-------- | Read | None | None | SSH private keys (strictest), sensitive credentials |
SSH is particularly strict about permissions. Your private key file (~/.ssh/id_rsa) must be 600 or 400, and the ~/.ssh directory must be 700. SSH will refuse to use keys with more permissive settings.
How to Use the chmod Calculator: Step-by-Step
Our interactive chmod calculator makes it easy to determine the right permissions without memorizing octal values. Here is how to use it:
- Toggle permission checkboxes — Click the read (r), write (w), and execute (x) boxes for Owner, Group, and Others. Each checkbox lights up when active, and the corresponding letter appears.
- Read the octal value — The three-digit octal number updates in real-time as you toggle permissions. The large display shows the complete value (e.g., 755).
- Check symbolic notation — Below the octal value, you will see the symbolic representation (e.g., rwxr-xr-x) for verification.
- Copy the chmod command — Click the copy button next to
chmod 755 filenameto copy the ready-to-paste terminal command. - Use presets for quick setup — Click any common permission preset (755, 644, 700, etc.) in the reference section to instantly set all checkboxes.
Reverse Lookup: Octal to Permissions
You can also type an octal value directly into the input field. The checkboxes will automatically update to show which permissions that value represents. This is useful when you encounter an unfamiliar permission value in a script or configuration file and want to understand what access it grants.
After copying the chmod command, replace filename with your actual file or directory path. For recursive changes on directories, add the -R flag: chmod -R 755 /var/www/html.
File Permissions vs Directory Permissions: Key Differences
While the same octal numbers are used for both files and directories, the permissions have subtly different effects depending on the target type.
How Permissions Differ
| Permission | On a File | On a Directory |
|---|---|---|
| Read (r) | View file contents (cat, less, open) | List directory contents (ls) |
| Write (w) | Modify or delete the file | Create, delete, or rename files within the directory |
| Execute (x) | Run the file as a program or script | Enter the directory (cd) and access its contents |
Important Implications
A directory without execute permission is effectively locked — even if a user has read permission, they cannot cd into it or access files within it by path. This is why directories almost always need the execute bit set (e.g., 755) while files usually do not (e.g., 644).
Conversely, a directory with write permission but without the "sticky bit" allows any user with write access to delete other users' files within it. This is why the /tmp directory uses 1777 (the leading 1 is the sticky bit) — everyone can create files, but only the file owner can delete their own files.
The standard rule for web servers: directories get 755, files get 644. This allows the web server to traverse directories and read files, while only the owner can modify them.
Security Best Practices for Linux File Permissions
- Never use 777 in production: chmod 777 gives everyone full access to read, write, and execute. This is the most common security mistake on Linux servers. If a web application has 777 permissions, any compromised service on the system can modify your files.
- Use the principle of least privilege: Grant only the minimum permissions needed. If a file only needs to be read by the web server, use 644 — not 755. If only the owner needs access, use 600 — not 644.
- Protect sensitive files with 600 or 400: Database credentials, API keys, .env files, and SSH private keys should never be world-readable. Use
chmod 600 .envandchmod 400 ~/.ssh/id_rsa. - Set proper web server ownership: Use
chown www-data:www-data(or your web server user) for web files, combined with 755/644 permissions. This ensures the web server can read files without giving write access to others. - Audit permissions regularly: Run
find /var/www -perm -777 -type fto find files with dangerous permissions. Automate this check in your CI/CD pipeline or monitoring system. - Use groups for team access: Instead of making files world-readable (644), create a group for your team and use 640. This limits access to authorized team members only.
- Be careful with recursive chmod: Running
chmod -R 755 /on the root directory can break your entire system. Always double-check the path before using the-R(recursive) flag.
When deploying web applications, use a deployment script that explicitly sets permissions: find /var/www/app -type d -exec chmod 755 {} \; for directories and find /var/www/app -type f -exec chmod 644 {} \; for files.
Symbolic vs Octal chmod Notation: When to Use Each
Linux supports two ways to specify permissions with chmod: octal (numeric) and symbolic (letter-based). Both achieve the same result, but each has advantages in different situations.
Octal Notation
Sets all permissions at once with a three-digit number. Best for setting absolute permissions when you know exactly what the final state should be.
chmod 755 myfile.sh # Set exact permissions
chmod 644 index.html # Owner rw, others read-only
chmod 600 .env # Owner only, no one else
Symbolic Notation
Modifies specific permissions using letters and operators (+, -, =). Best for adding or removing individual permissions without affecting others.
chmod u+x script.sh # Add execute for owner only
chmod g-w config.yml # Remove write from group
chmod o-rwx secret.key # Remove all permissions for others
chmod a+r readme.txt # Add read for all (a = all)
chmod u=rwx,g=rx,o=r file # Set exact (same as 754)
When to Use Each
| Scenario | Best Notation | Example |
|---|---|---|
| Setting up a new deployment | Octal | chmod 755 /var/www |
| Making a script executable | Symbolic | chmod +x deploy.sh |
| Removing write from others | Symbolic | chmod o-w file.txt |
| Locking down sensitive files | Octal | chmod 600 credentials.json |
| Scripts in CI/CD pipelines | Octal | Absolute values are more predictable |
Common chmod Mistakes and How to Avoid Them
Even experienced developers make permission mistakes. Here are the most common ones and how to avoid them:
- Using 777 as a quick fix: When something doesn't work due to permission errors, the temptation is to run
chmod 777and move on. Instead, check which user the process runs as (ps aux | grep process) and grant only the needed permissions to that user. - Forgetting execute on directories: A directory with 644 (rw-r--r--) is inaccessible because the execute bit is needed to enter directories. Directories should typically be 755, not 644.
- Recursive chmod on wrong path: Running
chmod -R 644 /var/wwwwill break all directories (they need execute). Usefindto set directories and files separately:find . -type d -exec chmod 755 {} \;andfind . -type f -exec chmod 644 {} \;. - Not setting ownership before permissions: Permissions are meaningless if the wrong user owns the file. Always run
chownfirst, thenchmod. - Ignoring umask defaults: New files inherit permissions from the system umask (usually 022, resulting in 644 for files and 755 for directories). If your files are consistently created with wrong permissions, check your umask setting with
umaskcommand. - Exposing .env and config files: Database passwords, API keys, and secrets in configuration files should always be 600 (owner read/write only). Never leave them at 644 on a shared server.
If you accidentally chmod 000 a file and cannot access it, you can fix it as root: sudo chmod 644 filename. If you've locked yourself out of a directory, use sudo chmod 755 dirname.
How to Use the Tool (Step by Step)
- 1
Toggle Permission Checkboxes
Click read, write, and execute for owner, group, and others to set the permissions you need.
- 2
Read the Octal Value
The three-digit octal number updates in real-time as you toggle permissions.
- 3
Copy the chmod Command
Click copy next to the generated command like "chmod 755 filename" and paste it into your terminal.
Frequently Asked Questions
What does chmod 755 mean?+−
chmod 755 gives the owner full access (read+write+execute), while group and others get read and execute only. This is the standard permission for web directories and executable scripts.
What does chmod 644 mean?+−
chmod 644 gives the owner read and write access, while group and others can only read. This is the standard permission for web files like HTML, CSS, images, and configuration files.
Why should I never use chmod 777?+−
chmod 777 gives every user on the system full read, write, and execute access. On a server, this means any compromised service can modify your files, creating a serious security vulnerability.
What is the difference between chmod and chown?+−
chmod changes the permissions (what actions are allowed), while chown changes the ownership (who the owner and group are). You typically run chown first to set the right owner, then chmod to set the right permissions.
What permissions should SSH keys have?+−
SSH private keys must be chmod 600 (or 400 for read-only). The ~/.ssh directory must be 700. SSH will refuse to use keys with more permissive settings for security.
How do I set permissions recursively?+−
Use the -R flag: chmod -R 755 /path/to/directory. However, for web deployments, use find to set directories (755) and files (644) separately to avoid making all files executable.
What does the execute permission do on a directory?+−
On a directory, execute permission allows users to enter the directory (cd into it) and access files within it. Without execute, even if a user has read permission, they cannot access the directory contents.
Is the chmod calculator free to use?+−
Yes. Our chmod calculator is completely free with no signup required. It runs entirely in your browser — no data is sent to any server.
Calculate chmod Permissions — Free & Instant
Toggle permissions interactively, see octal and symbolic notation in real-time, and copy the ready-to-paste chmod command. No signup, no server — runs in your browser.
Open chmod Calculator →Related Guides
Hash Generator — MD5, SHA-256, SHA-1 and More Explained (2026)
Generate MD5, SHA-1, SHA-256, SHA-512 hashes online — understand hashing, verify file integrity, secure data.
Strong Password Guide
NIST 2024 guidelines, time-to-crack tables, and the right way to manage passwords.
Base64 Encode & Decode — What It Is, How It Works & When to Use It
Developer guide to Base64 encoding: use cases, online decoder, and common pitfalls
Regex Tester — Test Regular Expressions Online Free (2026)
Test and debug regex patterns with real-time matching, syntax highlighting, and cheat sheet. Free, browser-based.