Skip to main content
· 7 min read

Chmod Permissions Explained: 755, 644, 777 and More

Written by Muhammad Ali · Senior Full Stack Software Engineer

Personal website: codedbymali.com

Learn what chmod 755, 644, 600 and 777 mean, how to read rwxr-xr-x, and how to set safe Linux file permissions with our free chmod calculator.

You upload a website and get "403 Forbidden". You try to SSH into a server and see "UNPROTECTED PRIVATE KEY FILE!". A deploy script says "Permission denied". All three problems come down to the same thing: Linux file permissions, and the command that fixes them, chmod.

This guide explains what numbers like 755 and 644 mean, how to read rwxr-xr-x, and which values are safe. If you just want the answer, use our free Chmod Calculator — tick the boxes or paste an ls -l line and get the command.

The three groups: owner, group, others

Every file on Linux has permissions for three kinds of users:

  • Owner (u) – the user who owns the file.
  • Group (g) – users in the file's group.
  • Others (o) – everyone else.

Each of them can have three rights:

  • r – read: view the file, or list a folder.
  • w – write: change the file, or add/delete files in a folder.
  • x – execute: run the file as a program, or enter (cd) a folder.

How the numbers work

Each right has a number: read = 4, write = 2, execute = 1. Add them up for each group and you get one digit per group.

Number Letters Meaning
0 --- no access
1 --x execute only
2 -w- write only
3 -wx write + execute
4 r-- read only
5 r-x read + execute
6 rw- read + write
7 rwx read + write + execute

So 755 means: owner 7 (rwx), group 5 (r-x), others 5 (r-x). Written as letters: rwxr-xr-x.

Worked example: reading an ls -l line

Run ls -l and you will see something like this:

-rwxr-x--- 1 deploy www-data 2048 Nov 19 10:00 deploy.sh

Break the first part into pieces:

  • - → a normal file (d would mean a folder).
  • rwx → owner deploy can read, write and run it = 7.
  • r-x → group www-data can read and run it = 5.
  • --- → everyone else has no access = 0.

So the file is 750. To set it again you would run:

chmod 750 deploy.sh
# same thing, written with letters:
chmod u=rwx,g=rx,o= deploy.sh

Paste that line into the Chmod Calculator and it does this breakdown for you.

Common chmod values cheat sheet

Value Letters Use it for
644 rw-r--r-- normal files, HTML, CSS, images
755 rwxr-xr-x folders and scripts
600 rw------- .env files, SSH private keys
400 r-------- read-only keys (e.g. AWS .pem)
700 rwx------ private folders like ~/.ssh
775 rwxrwxr-x shared team folders
777 rwxrwxrwx almost never — anyone can change it

Set folders and files separately

A very common mistake is chmod -R 755 . on a whole project. That makes every file executable, which you don't want. Set folders and files on their own instead:

find ./site -type d -exec chmod 755 {} +
find ./site -type f -exec chmod 644 {} +

The calculator's recursive helper writes these commands for you.

Special bits: setuid, setgid and sticky

Sometimes you see a fourth digit, like 4755 or 1777:

  • setuid (4) – the program runs as its owner (e.g. passwd). Shown as s in the owner part.
  • setgid (2) – on a folder, new files get the folder's group. Great for shared folders (2775).
  • sticky (1) – on a folder, users can only delete their own files. That's why /tmp is 1777. Shown as t.

A capital S or T means the special bit is set but execute is not.

What about umask?

umask decides the permissions of new files. With the usual umask 022, new files get 644 and new folders get 755. With 077, they get 600 and 700 — private to you. The calculator has a umask tab that shows this instantly.

Common mistakes

  • Using 777 to "fix" a problem. It works because it removes all security. Fix the owner (chown) or use 755/644 instead.
  • SSH keys that are too open. SSH refuses keys that others can read. Use chmod 600 ~/.ssh/id_ed25519.
  • Folders without execute. A folder with 644 can't be entered. Folders need x, so use 755.
  • chmod -R on everything. Use the find commands above to treat files and folders differently.

FAQ

What does chmod 755 mean? The owner can read, write and run the file; the group and everyone else can read and run it, but not change it.

What is the difference between 644 and 755? 644 has no execute bit, so it is for normal files. 755 adds execute, so it is for scripts and folders.

Why is chmod 777 dangerous? Any user on the system (or a hacked web app) can change or replace the file. On a web server that can lead to a site takeover.

What permissions should my SSH key have? 600 (or 400) for the private key and 700 for the ~/.ssh folder.

Is the chmod calculator safe to use? Yes. It runs 100% in your browser and nothing is sent to a server.


Try it now: Chmod Calculator →

Related tools: Number Base Converter, Dockerfile Generator, Nginx Config Generator, .env Config Checker.

Chmod Calculator