Linux File Permissions Explained: chmod 755, 644 and umask
Understand Linux and macOS permissions: read, write and execute for owner, group and others, octal and symbolic forms, special bits and what umask does.

Linux File Permissions Explained: chmod 755, 644 and umask
"Permission denied" is one of the most common errors on Linux and macOS, and the fix often involves chmod. But chmod 777, the fix many forum answers suggest, makes a file writable by everyone on the system, which is rarely what you want. This guide explains how permissions work so you can choose the right ones, and the free Chmod and Umask Calculator converts between the forms and writes the commands.
Three classes, three permissions
Every file and folder has an owner and a group. Permissions are set separately for three classes:
- Owner (user, u): the account that owns the file.
- Group (g): members of the file's group.
- Others (o): everyone else.
Each class has three permissions: read (r), write (w) and execute (x).
Octal numbers
Each permission has a value: read 4, write 2, execute 1. Add them for each class and write the three digits side by side. rwx is 4+2+1 = 7, r-x is 5, rw- is 6 and r-- is 4. So:
- 755 is rwxr-xr-x: the owner can do everything, others can read and run.
- 644 is rw-r--r--: the owner can edit, others can only read.
- 600 is rw-------: only the owner can read or write.
Folders work differently
On a folder, read means listing its contents, write means creating, renaming and deleting files in it, and execute means entering it and reaching the files inside. A folder without execute is useless even if it is readable. That is why folders are normally 755 and ordinary files 644, and why fixing a whole tree should treat them separately:
find site -type d -exec chmod 755 {} + find site -type f -exec chmod 644 {} +
Running chmod -R 755 on everything makes every file executable, which is untidy and sometimes unsafe.
Special bits
A fourth digit in front holds three special bits. setuid (4) makes a program run with its owner's rights; passwd uses it to update the password file. Never set it on scripts. setgid (2) on a folder makes new files inherit the folder's group, ideal for shared project folders (2775). sticky (1) on a shared folder stops users deleting each other's files, which is why /tmp is 1777. In ls -l output these show as s, s and t in the execute positions; a capital S or T means the bit is set without execute, usually a mistake.
What umask does
When a program creates a file it normally asks for 666 (rw-rw-rw-) and for a folder 777. The umask removes bits from that. With the common umask 022, write is removed for group and others, giving 644 files and 755 folders. With 027, others get nothing: 640 and 750. Check yours with the umask command and set it in your shell profile or a service's configuration.
Reading ls -l output
The first column of ls -l, such as -rwxr-xr-x, starts with a type letter (- for a file, d for a folder, l for a link) followed by the nine permission letters. The calculator accepts that whole string, so you can paste it straight from your terminal.
Common choices
- 600 for SSH private keys; SSH refuses keys others can read.
- 700 for ~/.ssh and other private folders.
- 644 for web pages and ordinary files.
- 755 for programs, scripts and folders.
- 775 or 2775 for folders shared by a team group.
Using the calculator
Type a mode as digits or letters, or tick the boxes, add special bits if needed, and you get both forms, a plain-language table of who can do what, chmod commands in numeric and symbolic style, and warnings for risky settings such as world-writable files. Enter your umask to see the defaults for new files and folders. Nothing is changed on your system; copy the commands and run them yourself.



