TurantToolsdev</> All tools

chmod 755 vs 644: Linux File Permissions Explained Simply

What the three digits mean, why folders need 755 and files 644, a quick reference for common modes, and why 777 is almost always the wrong fix.

By the TurantTools Dev team · Updated October 17, 2026 · 4 min read

Sooner or later every developer pastes chmod 755 from a Stack Overflow answer without being sure why. Permissions look cryptic, but there are only three numbers to understand, and once you can read them you'll stop guessing.

Three digits, three groups

Each digit is a group of people: the owner, the file's group, and everyone else. Each digit is a sum of three permissions:

  • 4 = read (r)
  • 2 = write (w)
  • 1 = execute (x)

So 7 = 4 + 2 + 1 (read, write, execute), 6 = 4 + 2 (read, write), 5 = 4 + 1 (read, execute) and 4 is read only.

755 vs 644

ModeSymbolicOwnerGroupOthers
755rwxr-xr-xread, write, runread, runread, run
644rw-r--r--read, writereadread

For a file, “execute” means it can be run as a program. Your HTML and images don't need that, so 644 is right for them. For a folder, “execute” means you can open it and reach the files inside. Without it, even a readable file in that folder can't be served, which is why folders are usually 755.

A quick reference

ModeUse it for
644Normal files: HTML, CSS, images, config you only read
755Folders and scripts that need to run
600Private files: SSH keys, .env, credentials
700Private folders such as ~/.ssh
664 / 775Files and folders shared with a group
777Everyone can write. Almost never what you want

Why not just use 777?

  1. It lets any user on the server change or replace the file, including a compromised plugin or another site on shared hosting.
  2. Some tools refuse to work with it: SSH ignores private keys that others can read, and PHP-FPM setups often block world-writable scripts.
  3. If something only works at 777, the real problem is usually the file's owner. Fix it with chown instead.
Chmod Calculator (Linux File Permissions)Tick boxes to get the octal and symbolic mode.

Sources we checked

Tools in this article

Binary, Hex, Decimal & Octal ConverterConvert any whole number between bases, with no size limitHash Generator (MD5, SHA-256, SHA-512)Hashes and HMAC for text and files, with checksum compare

More articles