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.
Step-by-Step Tutorial
Select Permission Bits
Toggle Read, Write, and Execute checkboxes for Owner, Group, and Public classes.
Inspect Octal & Symbolic Notation
Review generated numeric values (e.g. 755) and symbolic strings (rwxr-xr-x).
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.