Linux Chmod Permissions & IPv4 CIDR Subnetting Cheatsheet

Keep one bookmark for daily DevOps & server hardening: safe chmod presets (600, 644, 700, 755), SSH key fixes, RFC 1918 private subnets, and /24 to /32 CIDR host counts.

Part 1: Linux Chmod Octal Math & Production Presets

Every Linux file or directory defines three permission groups: Owner (u), Group (g), and Others (o). Each group sums three permission bits: Read = 4, Write = 2, and Execute = 1. Instead of memorizing arbitrary strings, add the bits per column—or toggle checkboxes visually in our Linux Chmod Calculator.

CodeSymbolicExact Production Use Case
600-rw-------SSH private keys, TLS private keys, .env secrets, database credentials
644-rw-r--r--HTML/CSS/JS assets, Nginx/Caddy configs, public certificates
700drwx------~/.ssh directory, private home folders, cron secret directories
755drwxr-xr-xPublic directories (execute bit enables traversal) and executable scripts
750drwxr-x---Service app directories shared only with the runtime group (e.g., www-data)

Safe Recursive Pattern: Never run chmod -R 755 blindly across a website folder (that marks static files executable). Instead separate directories and files cleanly: find /var/www/site -type d -exec chmod 755 {} + followed by find /var/www/site -type f -exec chmod 644 {} +.

Part 2: IPv4 CIDR Prefix Quick Reference (/16 through /32)

CIDR notation (192.168.5.0/24) specifies how many leading bits of a 32-bit IPv4 address belong to the fixed network prefix; the remaining 32 - prefix host bits determine block size (2^(32 - prefix) total addresses).

CIDRNetmaskTotal IPsUsable HostsTypical Role
/16255.255.0.065,53665,534Full cloud VPC CIDR block
/20255.255.240.04,0964,094Availability-zone subnet
/24255.255.255.0256254Office / home LAN, standard subnet
/26255.255.255.1926462Microservice or Kubernetes node pool
/28255.255.255.2401614Small DMZ or NAT egress block
/30255.255.255.25242Router-to-router point-to-point link
/32255.255.255.25511Single host SSH / firewall allowlist

Test exact subnet boundaries and octet bits live using IPv4 Subnet Calculator, CIDR to IP Range, and IPv4 to Binary Converter.

Frequently Asked Questions

What chmod permissions should ~/.ssh/authorized_keys have?
Set ~/.ssh to 700 and ~/.ssh/authorized_keys to 600 so OpenSSH accepts key-based authentication cleanly.
What are the three RFC 1918 private IPv4 ranges?
10.0.0.0/8 (16.7M IPs), 172.16.0.0/12 (1.04M IPs), and 192.168.0.0/16 (65,536 IPs).
Why do point-to-point router links sometimes use /31 instead of /30?
RFC 3021 allows /31 subnets on point-to-point links to use both addresses without wasting network and broadcast IDs.