Chmod Permissions Calculator & Generator
Calculate Linux and Unix file permissions visually with instant octal, symbolic, and binary conversion, SetUID/SetGID/Sticky bit modifiers, and production-ready CLI command generation.
Visual Permissions Grid
| Role | Read (4) | Write (2) | Execute (1) | Sum |
|---|---|---|---|---|
Owner (u)File Creator | 7 | |||
Group (g)Group Members | 5 | |||
Others (o)Public Users | 5 |
Calculated Values & Terminal Command
Live POSIX Matrix$ chmod 755 /var/www/html/app.sh$ chmod u=rwx,g=rx,o=rx /var/www/html/app.shPOSIX & Linux Chmod Permission Preset Matrix
Industry-standard permission configurations for web servers, scripts, and sensitive keys.
| Octal | Symbolic | Target Profile | Action |
|---|---|---|---|
| 0755 | -rwxr-xr-x | Standard Executable / Directory | |
| 0644 | -rw-r--r-- | Standard Public File | |
| 0700 | -rwx------ | Private Script / Directory | |
| 0600 | -rw------- | Private Sensitive File (.env, SSH Keys) | |
| 0777 | -rwxrwxrwx | Full Unrestricted Access | |
| 0664 | -rw-rw-r-- | Shared Group Workspace File | |
| 0775 | -rwxrwxr-x | Shared Group Directory | |
| 0400 | -r-------- | Read-Only Key / Certificate | |
| 1777 | -rwxrwxrwt | Sticky Public Directory (/tmp) | |
| 4755 | -rwsr-xr-x | SetUID Root Executable (passwd, sudo) |
Understanding Unix & Linux File Permission Architecture
Linux and POSIX-compliant operating systems utilize a Discretionary Access Control (DAC) security architecture to govern how users and system services interact with files and directories. Every file system node maintains a 12-bit mode structure containing permission triplets for three distinct user scopes: the file Owner (User), the assigned Group, and all Others (World).
Read Permission (r = 4)
For standard files, enables reading or opening file contents. For directories, enables listing folder contents via commands like ls.
Write Permission (w = 2)
For files, allows modifying, saving, or truncating contents. For directories, grants rights to create, delete, and rename files within the folder.
Execute Permission (x = 1)
For files, enables execution as a binary or shell script. For directories, acts as the search/traverse bit required to enter with cd.
Special Permissions: SetUID (4000), SetGID (2000), and Sticky Bit (1000)
Beyond standard read, write, and execute bits, POSIX systems define three special privilege flags represented by the leading fourth octal digit:
When executed, the process runs with the effective privileges of the file owner rather than the caller. Essential for utilities like passwd.
When applied to a directory, newly created files automatically inherit the parent directory's group rather than the user's primary group.
Applied to public shared directories like /tmp. All users can write files, but only the file owner or root can delete or rename them.
Chmod Command Syntax: Octal (Absolute) vs. Symbolic (Relative)
The chmod command accepts two distinct input syntaxes: Octal Numeric Mode and Symbolic Character Mode.
1. Octal (Absolute) Notation
Overwrites the entire permission bitmask directly with a 3-digit or 4-digit octal number.
# Set exact 755 permissions on a directory chmod 755 /var/www/html # Set recursive 644 on all public web assets chmod -R 644 /var/www/html/*.html
2. Symbolic (Relative) Notation
Adds (+), removes (-), or sets (=) specific permission bits without affecting unmodified flags.
# Add execute permission to file owner only chmod u+x deploy.sh # Remove write permissions from group and others chmod go-w sensitive-config.json
Production Hardening: Web Server & SSH Permission Recipes
Web Roots (Nginx / Apache / WordPress / Laravel)
Standard practice requires directories to be 755 (traversal + read) and static files to be 644 (read-only for web server daemon):
SSH Directory & Private Keys (~/.ssh)
OpenSSH enforces strict discretionary checking. Private keys must be restricted to 600 or 400; public keys are 644:
Frequently Asked Questions (FAQ)
How is the chmod octal permission number calculated?
Linux permissions are calculated by adding base weights for three operations: Read = 4, Write = 2, and Execute = 1. A permission score is calculated individually for Owner (User), Group, and Others. For example, Read + Write = 4 + 2 = 6; Read + Execute = 4 + 1 = 5. Combining these yields standard 3-digit notation such as 755 (rwxr-xr-x) or 644 (rw-r--r--).
What are the SetUID (4000), SetGID (2000), and Sticky Bit (1000) modifiers?
Special permission bits represent the leading 4th digit in chmod octal notation. SetUID (4) allows an executable to run with the permissions of the file owner (e.g. root for passwd). SetGID (2) makes files inherit the group ownership of their parent directory. The Sticky Bit (1) prevents users from deleting or renaming files inside a shared directory unless they are the file owner, as used on /tmp.
What is the security difference between chmod 777 and chmod 755?
Chmod 777 grants full Read, Write, and Execute access to everyone on the system, creating severe security vulnerabilities such as malicious file tampering and unauthorized script execution. In contrast, chmod 755 restricts write permissions strictly to the owner while allowing group members and external users to only view and execute the resource.
Why do directory permissions require the Execute bit (1)?
For directories in Linux/Unix, the Execute (x) permission bit represents traversal (search) access. Without execute access on a directory, a user cannot 'cd' into it or access any files inside, even if the user has Read permissions on the directory or the individual files within.
What permissions should be used for SSH private keys and .env files?
SSH private keys (~/.ssh/id_rsa or id_ed25519) and production environment secret files (.env) must be secured with chmod 600 (rw-------) or chmod 400 (r--------). The SSH client daemon actively rejects private key files if Group or Others have any read or write permissions.
Related & Complementary Utilities
Explore more privacy-first client-side web tools.
JWT Decoder, Inspector & Payload Auditor
Decode JSON Web Tokens (JWT) locally to inspect header parameters, payload claims, and expiration timestamps without transmitting secret keys over the wire.
Cron Expression Generator & Explainer
Generate and explain cron expressions with real-time human-readable translations, next execution dates, and custom schedulers.
CSS Grid Generator & Interactive Builder
Design responsive 2D layouts visually with fractional tracks, minmax constraints, and instant CSS/Tailwind export.