chmod 755 vs 644 Explained: Linux File Permissions Made Simple

WhatsApp
Telegram
Facebook
Twitter
LinkedIn
chmod 755 vs 644 file permissions comparison graphic

If you have ever managed a website, a server, or even just looked at a Linux tutorial, you have seen the numbers: chmod 755 vs 644. People type them like spells and move on, but few stop to explain what the digits actually mean. Get them wrong and your site breaks, your files refuse to upload, or worse, you hand strangers the keys to your server.

This guide explains Linux file permissions in plain language: what each digit in 755 and 644 means, when to use which, why 777 is dangerous, and how to work out any permission setting with a simple calculator.

What chmod actually does

Every file and folder on a Linux system has three sets of permission rules:

  1. Owner — the user account that owns the file (usually you)
  2. Group — the user group the file belongs to
  3. Others — everyone else on the system

For each of these three, Linux tracks three actions:

  • Read (r) — view the file’s contents, or list a folder’s contents
  • Write (w) — modify the file, or add/remove files inside a folder
  • Execute (x) — run the file as a program, or enter a folder

The chmod command changes which of these actions each group is allowed to do. The numbers are just a shorthand for the on/off switches.

Reading the numbers: 755, decoded

Each digit represents one group (owner, group, others). The digit is the sum of: read = 4, write = 2, execute = 1.

Digit4 (read)2 (write)1 (execute)Result
7YesYesYesrwx
5YesNoYesr-x
4YesNoNor–
0NoNoNo—

So 755 means:

  • Owner: 7 = read + write + execute — full control
  • Group: 5 = read + execute — can open and enter, but not change
  • Others: 5 = read + execute — same as group

And 644 means:

  • Owner: 6 = read + write — full control minus execute
  • Group: 4 = read only
  • Others: 4 = read only

In symbolic notation, 755 is rwxr-xr-x and 644 is rw-r--r--. Both notations say exactly the same thing; the numbers are just faster to type.

chmod 755 vs 644: which one do I use?

The rule of thumb for websites:

  • 755 for folders (and scripts that must run). A folder needs the execute bit to be “entered” by the server, so directories on a website are almost always 755.
  • 644 for files. A file rarely needs to be executed by the web server; it just needs to be read. HTML files, images, CSS files, and documents are 644.

If you upload a folder to your web host and set everything to 644, your site may throw “permission denied” errors because the server cannot enter the folders. If you set everything to 755, files get the execute bit they do not need — usually harmless, but not best practice.

For files on your own computer or a private server where only you matter, the exact settings matter less. But on any shared hosting, VPS, or production server, 755 for folders and 644 for files is the standard everyone follows.

The one setting you must avoid: chmod 777

chmod 777 gives everyone — every user on the system — full read, write, and execute access to the file or folder. Tutorials sometimes suggest it as a “quick fix” when something does not work. Do not do it.

With 777 on a folder, anyone who gains any access to the server can add, delete, or replace files there — including malicious scripts. If a tutorial tells you to use 777 permanently, find a better tutorial. If you must use it briefly for a diagnosis, change it back immediately.

Common safe alternatives:

  • 755 — folders the public needs to reach
  • 644 — files the public needs to read
  • 600 — private files only you should read and write (config files, keys)
  • 700 — private folders only you should enter

How to work out any permission setting yourself

Doing the 4-2-1 math in your head gets old fast, especially when you also need the symbolic form and the actual command. That is what a chmod calculator is for.

The Chmod Generator from Trencada works like this: tick checkboxes for read, write, and execute under owner, group, and others, and it instantly shows the octal number (like 755), the symbolic form (like rwxr-xr-x), and the ready-to-paste chmod command. It also includes one-click presets for the common cases above, so you never have to memorize the math.

A typical session looks like this:

  1. Decide what the file or folder needs — e.g. a folder your web server must enter: owner full control, everyone else read + enter.
  2. Tick the matching boxes: owner r+w+x, group r+x, others r+x.
  3. Copy the generated command: chmod 755 my-folder.
  4. Paste it into your terminal or SSH session.

No uploads, no signup, no account — permission math is done entirely in your browser.

If you want to skip the math entirely, use Trencada’s Chmod Calculator: tick the boxes and it hands you the octal number, the symbolic form, and the ready-to-paste command.

Applying chmod in practice

On a local Linux or macOS terminal:

chmod 755 my-folder      # folder the public can enter and read
chmod 644 index.html     # file the public can read

On a remote server over SSH, the same commands work. Most FTP clients (like FileZilla) also let you right-click a file, choose “File permissions”, and type the number directly.

To check the current permissions of a file, run ls -l:

-rwxr-xr-x  1 user group  4096 Sep 24 10:00 my-folder

The first ten characters (-rwxr-xr-x) are the permission string: the leading - means it is a file (a d would mean folder), followed by the three permission groups. That string is exactly what the calculator shows you.

Common mistakes and quick fixes

“403 Forbidden” on a website after uploading files. The folder is probably 644 or the file is 600. Set folders to 755 and files to 644.

A script will not run. The execute bit is missing. A common case is a deploy or backup script set to 644 — it needs 755 (or 700 if only you should run it).

SSH key not accepted (“bad permissions”). Your private key must be 600 — readable only by you. If it is 644 or 755, SSH refuses to use it for your own security. Fix with chmod 600 ~/.ssh/id_rsa.

Uploads fail but downloads work. The folder needs write permission for the uploading user — check whether owner, group, or others needs the w bit (write is 2 in the octal math).

Frequently asked questions

What does chmod 777 mean?

Read, write, and execute for everyone. It is the least secure setting and should never be used on a live server except for a brief diagnosis — and reverted immediately after.

What is the difference between 755 and 644?

755 includes the execute bit (needed to enter folders and run scripts); 644 does not. Use 755 for folders, 644 for files.

What are the numbers in chmod?

Each digit is the sum of read (4), write (2), and execute (1) for one group. The three digits cover owner, group, and others. 7 = 4+2+1 = all permissions; 5 = 4+1 = read and execute.

How do I recursively chmod a folder?

Add -R: chmod -R 755 my-folder. This changes the folder and everything inside it. Use carefully — files inside will also get the execute bit, which you may not want. A common pattern is setting folders and files separately.

Permissions, Minus the Intimidation

Linux permissions look intimidating until you learn the 4-2-1 trick, and then 755 and 644 read like plain English. Folders get 755 so the server can enter them, files get 644 so the server can read them, and 777 stays firmly off the table. When you are unsure, work the settings out in Trencada’s Chmod Calculator instead of guessing — guessing is how servers get compromised.

Trustpilot