Linux & DevOps ReferenceUpdated: 2026-11-05

Linux File Permissions, Octal Codes & Chmod Command Cheat Sheet

Quick lookup guide for 777, 755, 644, 600, umask, sticky bits, and symbolic vs numeric permissions notation.

In Unix and Linux operating systems, file access security is enforced via POSIX permissions. Every file and directory maintains an Access Control List divided into three entity tiers: User (Owner), Group, and Others. This reference card provides instant octal calculations, common server security presets, and permission recovery commands.

Permission Representation: Octal Values & Bits

Binary bit weights and their corresponding numeric octal representations.

PermissionSymbolicBinaryOctal ValueEffect on FileEffect on Directory
Read`r``100`4Read file contentsList files with `ls`
Write`w``010`2Modify or truncate fileCreate, rename, or delete files
Execute`x``001`1Run script or binary programAccess (`cd`) and traverse directory

Common Production Chmod Presets

Standard secure permission configurations for web servers (Nginx, Apache, Node.js).

Octal CodeSymbolic NotationTypical Target / Security Context
`600``-rw-------`SSH Private Keys (`id_rsa`), AWS `.pem` keys, confidential credentials
`644``-rw-r--r--`Standard public web files (HTML, CSS, JS, images, documents)
`700``drwx------`User `~/.ssh` directory, root private home folders
`755``drwxr-xr-x`Standard web directories, executable shell scripts (`deploy.sh`)
`777``drwxrwxrwx`DANGER: Full read/write/execute for all users. Never use in production!

Practical Terminal Commands

Day-to-day command snippets for managing permissions and ownership.

Fix Standard Web Permissions (Directories 755, Files 644)bash
# Set all directories to 755 (read & execute)
find /var/www/html -type d -exec chmod 755 {} +

# Set all files to 644 (read only for others)
find /var/www/html -type f -exec chmod 644 {} +
The golden rule for repairing broken WordPress or web application file permissions.
Secure SSH Private Key Permission Errorbash
chmod 400 ~/.ssh/id_rsa
chmod 700 ~/.ssh
Fixes "Permissions 0644 for id_rsa are too open" SSH connection rejection errors.

Frequently Asked Questions

Why does SSH reject private keys with 644 permissions?

SSH strictly enforces privacy: a private key readable by other system users violates cryptographic trust. SSH refuses to authenticate until permissions are locked down to `400` or `600`.

How do I calculate chmod codes interactively?

Use DocSwift's free in-browser Chmod Calculator. Click permission checkboxes to generate numeric and symbolic strings instantly.