$200 PERK Deploy cloud databases, droplets & cron jobs with $200 in free 60-day credits on DigitalOcean.
Home / Linux Chmod Calculator / Chmod 644
SAFE (STANDARD) Octal Mode: 644 • Symbolic: -rw-r--r--

Chmod 644 Permissions

Chmod 644: Chmod 644 gives the file owner read and write permissions (6), while the group and all other users receive read-only permissions (4). Represented symbolically as -rw-r--r--, it is the secure industry standard for static web files, configuration files, and documentation because it prevents execution attacks and unauthorized modifications.

Octal Code
644
Symbolic Notation
-rw-r--r--
Generated Bash Command
chmod 644 /var/www/html/index.html
Class Read (4) Write (2) Execute (1) Sum
Owner (User) ✓ ✓ — 6
Group ✓ — — 4
Others (Public) ✓ — — 4
ADVERTISEMENT ClientDev Tools

Technical Deep-Dive: Chmod 644 (-rw-r--r--)

Bitwise binary arithmetic, POSIX DAC rules, and security guidelines for production servers.

1. Binary Calculation Mechanics

POSIX file systems represent permissions in triplets of binary bits where Read is 4 (2^2), Write is 2 (2^1), and Execute is 1 (2^0). In chmod 644, each digit computes as:

  • • Owner: 6 (Read Write )
  • • Group: 4 (Read )
  • • Others: 4 (Read )

2. Practical CLI Execution

Apply this configuration to files or directories with the standard Linux terminal commands:

# Apply to specific target:
chmod 644 /var/www/html/index.html
# Apply recursively to subdirectories:
chmod -R 644 /var/www/html/index.html

Frequently Asked Questions

Why should web server files be set to chmod 644 instead of 755 or 777?

Static web assets (HTML, images, CSS, frontend JavaScript) should never have execute bits enabled. Setting them to 644 ensures web daemons like Nginx can read and serve them to HTTP clients, while malicious web uploads or local compromised processes cannot execute them as executable binaries.

How do I set chmod 644 on all files without changing directory permissions?

Use the Linux find utility: find /var/www/html -type f -exec chmod 644 {} +. This restricts the change strictly to regular files, keeping directory execute bits intact.

Can the file owner execute a file with chmod 644?

No. Because the execute bit (x) is 0 for the owner (6 = 4+2+0), even the file creator cannot run it directly from the terminal without explicitly prefixing the interpreter (e.g., bash script.sh or python script.py) or running chmod +x.