Home/Developer, Code & Web Engineering Tools/Chmod Permissions Calculator & Generator

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

RoleRead (4)Write (2)Execute (1)Sum
Owner (u)File Creator
7
Group (g)Group Members
5
Others (o)Public Users
5
Common Preset Profiles1-Click Setup

Calculated Values & Terminal Command

Live POSIX Matrix
Octal (Numeric)
Symbolic
-rwxr-xr-x
Binary Bits
111 101 101
$ chmod 755 /var/www/html/app.sh
$ chmod u=rwx,g=rx,o=rx /var/www/html/app.sh
Active Policy: 755 (rwxr-xr-x)Standard POSIX discretionary access control permissions configured.

POSIX & Linux Chmod Permission Preset Matrix

Industry-standard permission configurations for web servers, scripts, and sensitive keys.

OctalSymbolicTarget ProfileAction
0755-rwxr-xr-xStandard Executable / Directory
0644-rw-r--r--Standard Public File
0700-rwx------Private Script / Directory
0600-rw-------Private Sensitive File (.env, SSH Keys)
0777-rwxrwxrwxFull Unrestricted Access
0664-rw-rw-r--Shared Group Workspace File
0775-rwxrwxr-xShared Group Directory
0400-r--------Read-Only Key / Certificate
1777-rwxrwxrwtSticky Public Directory (/tmp)
4755-rwsr-xr-xSetUID 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:

SetUID (4000)rwsr-xr-x

When executed, the process runs with the effective privileges of the file owner rather than the caller. Essential for utilities like passwd.

SetGID (2000)rwxr-sr-x

When applied to a directory, newly created files automatically inherit the parent directory's group rather than the user's primary group.

Sticky Bit (1000)rwxrwxrwt

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):

find /var/www/html -type d -exec chmod 755 \; && find /var/www/html -type f -exec chmod 644 \;

SSH Directory & Private Keys (~/.ssh)

OpenSSH enforces strict discretionary checking. Private keys must be restricted to 600 or 400; public keys are 644:

chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa ~/.ssh/authorized_keys && chmod 644 ~/.ssh/*.pub

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.

Found this tool helpful? Share it with others!

Share on Facebook
Share on X
Share on LinkedIn
Copy URL

Related & Complementary Utilities

Explore more privacy-first client-side web tools.