HomeGuidesThe Complete Guide to Linux File Permissions: Chmod 755 vs 644 Explained
Developer & DevOps6 min readUpdated 2026-11-05

The Complete Guide to Linux File Permissions: Chmod 755 vs 644 Explained

Understand Unix POSIX security: user/group/other classes, octal arithmetic, umask, and resolving web server permission errors.

Need to do this immediately?

Use our free, private client-side browser tool with zero installation.

Launch Interactive Chmod Calculator
When setting up Nginx, Apache, or a Node.js server, developers frequently encounter '403 Forbidden' errors. Frustrated, many run 'chmod -R 777 /var/www', inadvertently granting world-writable permissions to malicious attackers. Understanding why 755 and 644 are the universal standards resolves errors securely.

Why Directories Need Execute (x) Permissions

On regular files, the execute (x / 1) bit allows running a script or binary program. On directories, however, the execute bit controls traversal: the ability to enter (cd) into the directory and access child files.

If a directory has read (r) permission without execute (x), users can list file names with ls, but cannot read file contents or stat file metadata. This is why web directories MUST be set to 755 (drwxr-xr-x).

Why Files Should Be 644 (-rw-r--r--)

Standard web assets (HTML, CSS, images, PHP scripts) do not need to be executed by system users directly; the web server process (www-data) merely needs to read the file bytes.

Setting files to 644 grants read and write to the owner, and read-only access to group and world users, completely blocking unauthorized file tampering.

Pro Tip:Never assign 777 to web directories; an attacker exploiting an upload form can execute arbitrary root scripts.

Step-by-Step Tutorial

1

Select Permission Bits

Toggle Read, Write, and Execute checkboxes for Owner, Group, and Public classes.

2

Inspect Octal & Symbolic Notation

Review generated numeric values (e.g. 755) and symbolic strings (rwxr-xr-x).

3

Copy Terminal Command

Copy the exact chmod command to apply across your server fleet.

Ready to Try It Yourself?

DocSwift processes everything directly on your device. Fast, safe, and completely free forever.

How helpful was this guide?

Rated 4.9 / 5 by 3,420+ users worldwide

Share with Colleagues & Friends

Help others protect their document privacy

Frequently Asked Questions

What does umask 022 mean in Linux?

Umask defines default permissions for newly created files. A umask of 022 subtracts write permissions for group and others, automatically creating new files as 644 and directories as 755.

How do I fix all file permissions in a folder recursively?

Run find . -type d -exec chmod 755 {} + for directories, and find . -type f -exec chmod 644 {} + for files.