chmodcalculator

chmod 644 Explained

rw-r--r--

chmod 644 is the universal standard for non-executable public and web files. It ensures the file owner can read and edit the file, while everyone else on the system (including web server engines) can safely read it without tampering with the content.

Interactive chmod 644 Calculator

Customize target file or flags
Ready-to-run Linux command
chmod 755 filename

Permission Checkbox Matrix

Click any permission to recalculate instantly
User / Owner (u)
File creator / owner
Total:7
Group (g)
Assigned user group
Total:5
Others / Public (o)
All other system users
Total:5
4thAdvanced / Special Permissions (SUID, SGID, Sticky Bit)
Dynamic Permission Translation
Owner:Read, Write, Execute (Full access)
Group:Read, Execute
Others:Read, Execute
File vs Directory Semantics

For Files: x allows binary or script execution.
For Directories: x is the search/traverse bit, required to cd into the directory and access inner files. Without directory execute, users cannot open subdirectories even with read rights!

Quick Permission PresetsClick to apply
Copied to clipboard

Bit Breakdown for 644

Owner (6)
4 + 2 + 0 = 6
rw- (Read & Write)
Group (4)
4 + 0 + 0 = 4
r-- (Read Only)
Others (4)
4 + 0 + 0 = 4
r-- (Read Only)

Why chmod 644 is Critical for Web Servers

On modern Linux web servers running Nginx, Apache, or Caddy, web content is stored on disk and read by a daemon user account (e.g. www-data).

If files are set to 600 or 700, the web server cannot read them, causing an HTTP 403 Forbidden error. If they are set to 777 or 666, anyone with a process on the server could inject malicious code or overwrite assets. Setting them to 644 achieves the ideal balance:

  • Owner: You can upload, update, and edit your code via SFTP, SSH, or Git.
  • Web Server (Others): The server can transmit HTML, CSS, JavaScript, and images to visitors.
  • Security: Visitors and outside processes cannot modify, delete, or append data to the file.

The Webmaster Standard Command

A common mistake is running chmod -R 644 on a directory. This breaks the entire directory tree because directories lose their execute (x) bit, preventing access to files inside! Instead, use the two-part standard:

// 1. Set all directories to 755 (enterable)
find /var/www/html -type d -exec chmod 755 {} +
// 2. Set all regular files to 644 (readable)
find /var/www/html -type f -exec chmod 644 {} +