Skip to main content
Dev & Data Popular

Linux Permissions & Chmod Numeric/Symbolic Calculator

Calculate Linux file and directory permissions interactively with octal numeric notation (755, 644, 777), symbolic notation (rwxr-xr-x), special bits (SUID, SGID, Sticky Bit), and command generator.

Interactive permission grid for Owner (User), Group, and Others with Read (r=4), Write (w=2), and Execute (x=1)
Bi-directional instant calculation: click checkboxes to update octal/symbolic notation, or type numeric octal (e.g. 755) to update checkboxes
Full support for Special Unix Bits: SUID (Setuid = 4), SGID (Setgid = 2), and Sticky Bit (= 1)
Command generator with flags: chmod -R (recursive), chown, and symbolic command syntax (chmod u+x,g-w)
Quick preset selector for standard Unix configurations: 755 (Web scripts/folders), 644 (Static assets), 600 (SSH keys), 400 (Private certs)
CONSOLE // POSIX PERMISSION CALCULATORLinux Chmod Permission CalculatorOCTAL: 755 • u=rwx,g=rx,o=rx
OCTAL NOTATION
SYMBOLIC FORM
-rwxr-xr-x
CHMOD SYNTAX
u=rwx,g=rx,o=rx
BUFFER // PERMISSION MATRIX
SCOPEREAD (4)WRITE (2)EXECUTE (1)TOTAL
OWNER (USER)7
GROUP5
PUBLIC (OTHERS)5
SPECIAL BITS (ADVANCED FLAGS)
CAPABILITY BREAKDOWN
OWNER:Read file contents, Modify & delete, Execute as binary/script
GROUP:Read file contents, Execute as binary/script
OTHERS:Read file contents, Execute as binary/script
INSPECTOR // COMMAND GENERATOR
OCTAL COMMAND
chmod 755 script.sh
SYMBOLIC COMMAND
chmod u=rwx,g=rx,o=rx script.sh
LS -L OUTPUT
-rwxr-xr-x 1 dev staff 4096 Feb 28 script.sh
Standard Permission Config

Balanced access configuration following standard POSIX file privilege conventions.

OUTPUT // COMMON PRESETS
WebCraftKit platform · 100% client-side engine

Air-Gapped Privacy & Zero-Latency Developer Utilities

Every cryptographic algorithm, schema transformer, color space converter, and binary extractor runs entirely in your browser RAM. Your tokens, API secrets, and source code are never sent to external servers.

0 B server telemetry
·
< 2ms execution
·
80 production tools
Read architecture story →
Comprehensive technical manual

Mastering POSIX File Permissions: The Complete Guide to Chmod, Octal Notation, and Special Bits

In-depth specifications, architectural mechanics, real-world code implementations, and industry best practices.

01

The POSIX Security Model: Users, Groups, and Permissions

  • • In POSIX-compliant operating systems (Linux, macOS, BSD, Unix), access control for files and directories is governed by an access matrix encompassing three distinct entity classes:
  • • Owner / User (u): The individual user account that owns the file.
  • • Group (g): The user group assigned to the file, allowing shared team access.
  • • Others / Public (o): All other users on the operating system.

Each entity class can be granted three fundamental operations: Read (r, permission to view contents or list directory), Write (w, permission to modify, rename, or delete), and Execute (x, permission to run a binary or traverse into a directory).

Implementation example
# Standard Linux ls -l output breakdown
# -rwxr-xr-- 1 deploy www-data 4096 Aug 28 01:00 server.sh
# ┬└──┬──└──┬
# │   │  └── Others: Read only (r--)
# │   └───── Group: Read & Execute (r-x)
# └───────── Owner: Read, Write & Execute (rwx)
02

Mathematical Octal Representation & Binary Bitmasks

  • • Unix permissions are represented mathematically as a 3-digit octal (base-8) number (or 4 digits when special bits are included). Each permission corresponds to a binary bit position:
  • • Read (r) = 4 (Binary 100)
  • • Write (w) = 2 (Binary 010)
  • • Execute (x) = 1 (Binary 001)
  • • None (-) = 0 (Binary 000)

Summing the values produces a single digit from 0 to 7 per entity class. For example: rwx = 4 + 2 + 1 = 7; r-x = 4 + 0 + 1 = 5; r-- = 4 + 0 + 0 = 4. Combining these gives 754.

Implementation example
// Octal Calculation Formula
const calculateOctal = (r: boolean, w: boolean, x: boolean): number => {
  return (r ? 4 : 0) + (w ? 2 : 0) + (x ? 1 : 0);
};

const owner = calculateOctal(true, true, true);  // 7 (rwx)
const group = calculateOctal(true, false, true); // 5 (r-x)
const other = calculateOctal(true, false, false);// 4 (r--)
const chmodMode = `${owner}${group}${other}`;    // "754"
03

Special Permission Bits: SUID, SGID, and Sticky Bit Explained

  • • Beyond basic read, write, and execute permissions, Unix provides three advanced special permission bits:
  • • SUID (Set User ID, Octal 4000): When set on an executable, users run the program with the privileges of the file owner (e.g., /usr/bin/passwd).
  • • SGID (Set Group ID, Octal 2000): On executables, runs with group privileges. On directories, forces all newly created files to inherit the parent directory's group ownership.
  • • Sticky Bit (Octal 1000): Set on shared directories (like /tmp) to ensure only the file owner or root can delete or rename files within.
Implementation example
# Examples of Special Bits in Linux
# 1. Sticky Bit on /tmp (Represented as 't' at the end)
drwxrwxrwt 15 root root 4096 /tmp

# 2. SUID on binary (Represented as 's' in owner position)
-rwsr-xr-x 1 root root 68208 /usr/bin/sudo

# Setting special bits via chmod:
chmod 1777 /tmp           # Set Sticky bit (1) + rwxrwxrwx (777)
chmod 2775 /var/www/html  # Set SGID (2) + rwxrwxr-x (775)
chmod 4755 /usr/bin/app   # Set SUID (4) + rwxr-xr-x (755)
04

Practical Step-by-Step Workflow & Common Command Presets

  • • Use WebCraftKit Chmod Calculator to generate exact deployment commands:
  • • Step 1: Select or toggle permission checkboxes for Owner, Group, and Others.
  • • Step 2: Observe real-time synchronization with 3-digit octal (e.g. 755) and symbolic notation (-rwxr-xr-x).
  • • Step 3: Choose common security presets from the dropdown:
  • • - 644 (rw-r--r--): Standard configuration and HTML/CSS files.
  • • - 755 (rwxr-xr-x): Executable scripts and public web directories.
  • • - 600 (rw-------): Private SSH keys (~/.ssh/id_rsa) and .env credential files.
  • • - 400 (r--------): Read-only private SSL certificates.
  • • Step 4: Toggle recursive (-R) flag if applying to directory trees, then copy the generated command.
Implementation example
# Standard Web Server Production Permissions Best Practice
# Set all directories to 755
find /var/www/mywebsite -type d -exec chmod 755 {} +

# Set all static files to 644
find /var/www/mywebsite -type f -exec chmod 644 {} +

# Secure sensitive configuration file
chmod 600 /var/www/mywebsite/.env
05

Security Hardening & Production Vulnerabilities (Why 777 is Dangerous)

Granting chmod 777 (rwxrwxrwx) permits every local user and web service process to read, overwrite, modify, and execute arbitrary code. If an attacker exploits an unauthenticated upload vulnerability on a 777 directory, they can upload a web shell (.php, .py) and execute it with full server privileges. Always adhere to the Principle of Least Privilege: grant only the minimum permissions required for an application to function.

Implementation example
# ❌ CRITICAL SECURITY RISK: Never use 777 in production!
chmod 777 /var/www/html/uploads

# ✅ Secure Hardened Alternative: Web server owns folder with 755/750
chown -R www-data:www-data /var/www/html/uploads
chmod 755 /var/www/html/uploads
Knowledge base & clarifications

Frequently Asked Questions: Chmod Calculator

Got questions about how Chmod Calculator operates, client-side cryptographic safety, or performance limits? Explore common answers below.

What is the difference between chmod 755 and chmod 644?

Chmod 755 gives the owner read, write, and execute permissions (rwx), while group and others receive read and execute (r-x), making it ideal for directories and executables. Chmod 644 gives the owner read and write (rw-), while group and others receive read-only (r--), standard for static files.

Why should I never use chmod 777 on a production web server?

Chmod 777 grants full read, write, and execution rights to every user on the system. If an attacker uploads a malicious script through your web application, they can immediately execute it, overwrite core files, and compromise the server.

What permissions should I set for SSH private keys (.ssh/id_rsa)?

SSH private keys must be set to 600 (rw-------) or 400 (r--------). Modern SSH clients (OpenSSH) will strictly refuse to connect and throw a "Permissions are too open" error if private keys are accessible by group or others.

What are SUID, SGID, and Sticky Bit in Linux?

SUID (4) runs a program with the permissions of the file owner; SGID (2) runs with group privileges or enforces group inheritance in directories; Sticky Bit (1) ensures only the file owner can delete files inside a shared directory like /tmp.

How do I set directory permissions to 755 and files to 644 recursively?

Use the find command: "find . -type d -exec chmod 755 {} +" to set all directories, and "find . -type f -exec chmod 644 {} +" to set all files without manually traversing subfolders.

Complementary utilities
View all in Dev & Data →