$200 PERK Deploy cloud databases, droplets & cron jobs with $200 in free 60-day credits on DigitalOcean.
POSIX DAC ENGINE 100% In-Browser • Zero Server Calls

Linux Chmod Calculator

A chmod calculator translates POSIX Linux file permissions into their corresponding 3-digit octal codes (755 for executables and directories, 644 for web assets, or 600 for SSH keys) and 9-bit symbolic strings (-rwxr-xr-x) while flagging SetUID, SetGID, and Sticky Bit execution rights.

0

Type 3 or 4 digits to sync

Symbolic Representation
-rwxr-xr-x

File type & bitmask flags

Terminal Command
chmod 755 /var/www/html
Ready for terminal execution Test on KVM VPS (20% off) ↗
Common Security Presets:
User Class Read (r / 4) Write (w / 2) Execute (x / 1) Sum
Owner (User) File creator or designated owner 7
Group Users in the file's primary group 5
Public (Others) All other accounts & system daemons 5
Special Permission Bits (Advanced):
ADVERTISEMENT ClientDev Tools
SYSADMIN STACK Recommended Linux infrastructure & terminal hardware:
DigitalOcean Ubuntu Droplets $200 FREE (60-day sandbox to test server permissions & cron) · Keychron K2 Wireless Keyboard SYSADMIN GEAR (tactile switches for terminal ops) · Yubico YubiKey 5C NFC SSH SECURITY (hardware FIDO2 key for root SSH access)

Production Linux Chmod Presets (Copyable CLI Commands)

Pre-rendered, standard permission configurations verified for Linux distributions (Ubuntu, Debian, RHEL, Alpine).

PRE-RENDERED
chmod 755 (Web Dirs) rwxr-xr-x

Standard directory & executable script permissions. Owner has full control; web server / visitors can read and enter.

chmod 755 /var/www/html
chmod 644 (Static Assets) rw-r--r--

Standard static web asset permissions (HTML, CSS, JS, images, configs). Prevents unauthorized script execution.

chmod 644 index.html
chmod 600 (SSH Keys) rw-------

Mandatory for SSH private keys (id_rsa) and .env files. Eliminates "Permissions are too open" warnings.

chmod 600 ~/.ssh/id_rsa
chmod 700 (~/.ssh Directory) rwx------

Secures personal user directories. Only the owner can list, read, or traverse files inside this directory.

chmod 700 ~/.ssh
chmod 400 (AWS EC2 PEM) r--------

Strict read-only permissions for AWS EC2 instance PEM keypairs. Prevents accidental modification or group inspection.

chmod 400 my-key.pem
chmod 1777 (/tmp Shared) rwxrwxrwt

Sticky bit on world-writable directories. Allows everyone to write files, but only the file creator or root can delete them.

chmod 1777 /tmp

Linux Permissions & Octal Cheat-Sheet Table

Complete reference mapping octal notation, symbolic modes, user classes, security risk levels, and sysadmin best practices.

Octal Symbolic User (Owner) Group Public (Others) Security Risk Production Use Case
400 r-------- Read (4) None (0) None (0) ULTRA SECURE AWS EC2 PEM private keys, root certificates
600 rw------- Read + Write (6) None (0) None (0) VERY SECURE SSH private keys (~/.ssh/id_rsa), .env secrets
644 rw-r--r-- Read + Write (6) Read (4) Read (4) SAFE (STANDARD) Public web assets (HTML, CSS, images), /etc config files
700 rwx------ Read + Write + Exec (7) None (0) None (0) VERY SECURE Private personal folders, ~/.ssh/ directory, root backups
755 rwxr-xr-x Read + Write + Exec (7) Read + Exec (5) Read + Exec (5) SAFE (STANDARD) Web server directories (/var/www), binary executables, shell scripts
775 rwxrwxr-x Read + Write + Exec (7) Read + Write + Exec (7) Read + Exec (5) MODERATE RISK Team collaboration folders with shared group privileges
777 rwxrwxrwx Read + Write + Exec (7) Read + Write + Exec (7) Read + Write + Exec (7) CRITICAL HAZARD Banned in production. Grants total control to any process/attacker
1777 rwxrwxrwt Read + Write + Exec (7) Read + Write + Exec (7) Read + Write + Exec + Sticky (17) CONTROLLED Multi-user temporary directories (/tmp, /var/tmp)

Mastering UNIX File System Permissions & Octal Masks

Theoretical mechanics of POSIX discretionary access control, bitwise modes, and Linux security hygiene.

1. The 3-Bit Permission Octal Model

In UNIX and Linux operating systems, every file inode associates nine permission bits organized into three triplets: Owner (User), Group, and Others (World). Each bit corresponds to binary powers of two: Read (4, 2^2), Write (2, 2^1), and Execute (1, 2^0). Summing each triplet yields a single octal digit from 0 to 7.

2. The Special Modes: SetUID, SetGID, and Sticky Bit

A fourth leading octal digit represents special kernel execution semantics. The SetUID bit (4000) causes binary execution to assume the effective UID of the file's owner. SetGID (2000) preserves group ownership inside collaborative shared folders. The Sticky Bit (1000) prevents non-owners from unlinking files in world-writable directories such as /tmp.

3. Testing Permissions in Isolated Sandbox Environments

Before issuing recursive permission updates (chmod -R) or altering sensitive service directories in production, sysadmins should test permission changes in disposable virtual machines. Spinning up an isolated sandbox using Hostinger KVM VPS (20% off) provides dedicated root access with instant OS reinstallation. For automated CI/CD staging environments and disposable Linux droplets, DigitalOcean provides $200 in free trial credits.

Frequently Asked Questions

What is a chmod calculator and how does octal permission notation work?

A chmod calculator converts standard POSIX Linux file permissions between 3-digit octal codes and 9-bit symbolic strings (-rwxr-xr-x). Octal notation uses base-8 numbers representing User (Owner), Group, and Others. The numbers sum the values 4 (Read), 2 (Write), and 1 (Execute). For example, 755 represents Read+Write+Execute (4+2+1=7) for Owner, and Read+Execute (4+1=5) for Group and Others.

chmod 777 vs 755: Which should I use and why is 777 dangerous?

Chmod 777 grants full Read, Write, and Execute access to every user on the system, including web server daemons (www-data). Any unprivileged attacker or compromised process can overwrite files, inject backdoors, or delete directories. For web directories and public scripts, always use chmod 755 (owner full access, others read & execute only). For web static files (HTML, CSS, images), use chmod 644.

How do I fix SSH error: 'Permissions 0644 for id_rsa are too open'?

OpenSSH requires private keys to be protected against unauthorized read access by other local users. If permissions are too permissive, SSH aborts with 'Permissions 0644 for id_rsa are too open'. Fix this immediately by running 'chmod 600 ~/.ssh/id_rsa' (or 'chmod 400' for read-only). Ensure the ~/.ssh directory is set to 'chmod 700'.

How do I recursively set 755 for directories and 644 for files in Linux?

Never run 'chmod -R 755' across an entire project because it erroneously marks static text files as executable binaries. Instead, use find: 'find /var/www/html -type d -exec chmod 755 {} +' for all directories, and 'find /var/www/html -type f -exec chmod 644 {} +' for all files.

What do SetUID (4000), SetGID (2000), and Sticky Bit (1000) do?

SetUID (SUID / 4000) allows executable files to run with the privileges of the file owner (e.g., /usr/bin/passwd running as root). SetGID (SGID / 2000) causes executables to run with group privileges and ensures newly created files in a folder inherit parent directory group ownership. The Sticky Bit (1000) prevents non-owners from unlinking or deleting files in world-writable shared directories like /tmp.