chmod 644 Linux Permissions Calculator

Symbolic: -rw-r--r-- · Owner read/write, group & others read-only · Default Linux file mode

chmod 644 (0644) LOW RISK SSH KEY REJECTED
4-digit: 0644
Dir: drw-r--r--
Presets:
Interactive Permission Matrix (3×3 + Special Bits) -rw-r--r--
Scope Read (4) Write (2) Execute (1) Digit Sum
Owner (u) 4(r) + 2(w) = 6
Group (g) 4(r) = 4
Others (o) 4(r) = 4
Special Mode Bits (4th Leading Octal Digit) 0 (none)
File / Dir Symbolic
-rw-r--r-- / drw-r--r--
Binary Bitmask
110 100 100
umask Complement
Dir 133 · File 022
umask 022 creates files as 644 (dirs as 755).
Security Audit & Command Builder
Clean Least-Privilege Permission Set: Mode 644 restricts write access to the owner and avoids world-writable or SUID escalation risks.
OpenSSH Audit (SSH KEY REJECTED): OpenSSH rejects private keys with 0644: "Permissions 0644 for 'id_ed25519' are too open. UNPROTECTED PRIVATE KEY FILE!" Run chmod 600 instead.
Apply Permission (Octal & Symbolic)
chmod 644 filename
Symbolic: chmod u=rw,g=r,o=r filename
Recursive chmod -R
chmod -R 644 filename
Safe Recursive Split (Dirs vs Files via find)
find filename -type d -exec chmod 755 {} +
find filename -type f -exec chmod 644 {} +
Verify Permissions with stat
stat -c "%a %A %U:%G %n" filename
macOS/BSD: stat -f "%Op %Sp %Su:%Sg %N" filename
Side-by-Side Octal Comparison
Open /chmod/755/ →
Property chmod 644 (-rw-r--r--) chmod 755 (-rwxr-xr-x)
Octal (3/4-Digit)644 (0644)755 (0755)
File Symbolic-rw-r--r---rwxr-xr-x
Directory Symbolicdrw-r--r--drwxr-xr-x
Owner (u)Read, Write (6)Read, Write, Execute (7)
Group (g)Read (4)Read, Execute (5)
Others (o)Read (4)Read, Execute (5)
Special BitsNoneNone
Binary Bits110 100 100111 101 101
Matching umaskDir: 133 / File: 022Dir: 022 / File: 022
Security RiskLOW RISKLOW RISK
SSH Private KeySSH KEY REJECTEDSSH KEY REJECTED
Common Use CaseUniversal Linux default for regular non-executable files: HTML/CSS/JS web assets, source code, Markdown docs, public SSH keys (.pub), and non-secret configs.Standard web directories & executable binaries/scripts (/var/www/html, /usr/local/bin)
chmod 644 · -rw-r--r-- umask 133 (dir) / 022 (file)
Ctrl+Enter: Copy chmod · 100% Browser-Local
Advertisement
Reserved fixed-height slot (CLS = 0.00) 728×90 320×100 300×50

chmod 644 vs 755: The Golden Rule for Web Servers and Linux Files

chmod 644 (-rw-r--r--) is the universal Linux standard for regular files created under the default umask 0022. The file owner can read and edit the file, while group members and other users (including Nginx or Apache worker processes) have read-only access and no execute bit. Using 644 for HTML, CSS, JS, JSON, images, and PHP/Python source files prevents accidental execution and stops web workers from overwriting application files.

Never run chmod -R 644 on a web directory tree: stripping the execute (+x) bit from directories immediately triggers HTTP 403 Forbidden because the OS cannot traverse a 644 directory. Instead, always separate directories (755) from files (644) using two safe find commands: find /var/www/site -type d -exec chmod 755 {} + and find /var/www/site -type f -exec chmod 644 {} +.

  • Symbolic Mode-rw-r--r-- (file) · drw-r--r-- (directory) · Octal 0644
  • Permission BitsOwner: rw- (6) · Group: r-- (4) · Others: r-- (4)
  • Matching umaskumask 0022 (Linux default: 666 - 022 = 644 for files)
What is the difference between chmod 644 and chmod 755?

chmod 644 (-rw-r--r--) is for regular non-executable files. chmod 755 (-rwxr-xr-x) adds the execute bit, which is required for directories (traversal) and executable scripts/binaries.

Why did chmod -R 644 break my Nginx website with 403 Forbidden?

Because chmod -R 644 also removed the execute (+x) bit from subdirectories. Restore directories to 755 with find /var/www/html -type d -exec chmod 755 {} + while keeping files at 644.

Is chmod 644 safe for .env or SSH private key files?

No. Because 644 allows all local users to read the file, sensitive files like .env and SSH private keys should use chmod 600 (or 640 if a dedicated service group needs read access).