Skip to main content
hank-builds.com
Home Dev ToolsChmod Calculator

Chmod Calculator

Chmod Calculator

ReadWriteExecuteOctal
Owner7
Group5
Other5
Symbolic

-rwxr-xr-x

Command

chmod 755

Need a full color palette?Color Palette Generator

Reading a Unix permission mode

A Unix file mode is three octal digits, one each for the owner, the group, and everyone else, in that order. Within each digit, read is worth 4, write is worth 2 and execute is worth 1, and the digit is their sum. There is no ambiguity because 4, 2 and 1 are powers of two: every value from 0 to 7 decomposes exactly one way.

So 755 reads as: owner 7 = 4+2+1 = read, write and execute; group 5 = 4+1 = read and execute; others 5 = the same. That is the standard mode for a directory or a program.

Worked examples

ModeSymbolic
755rwxr-xr-xDirectories and executables.
644rw-r--r--Ordinary readable files.
600rw-------Private files. SSH requires this on private keys.
700rwx------A private directory.
664rw-rw-r--Group-writable shared files.
777rwxrwxrwxEveryone can do everything. Almost always the wrong answer.

Octal digit values

DigitSymbolicPermissions
0---None
1--xExecute
2-w-Write
3-wxWrite, execute
4r--Read
5r-xRead, execute
6rw-Read, write
7rwxRead, write, execute

Worth knowing

  • Read = 4, write = 2, execute = 1. Add them for the digit: 7 is all three, 6 is read and write, 5 is read and execute, 0 is nothing.
  • The three digits are owner, group, other, in that order. A fourth leading digit, when present, holds setuid (4), setgid (2) and the sticky bit (1).
  • On a directory, execute means "may traverse". A directory with read but not execute lets you list the names inside it but not open any of them, which is rarely what anyone wants.
  • 644 for files and 755 for directories is the ordinary default pairing: everyone can read, only the owner can write, and directories are traversable.

Frequently asked questions

What does chmod 755 mean?
The owner can read, write and execute; the group and everyone else can read and execute but not write. It is the normal mode for directories and for programs meant to be run by any user on the system.
Why are files 644 but directories 755?
Because the execute bit means different things for each. On a file it means the file can be run as a program, which an ordinary document should not be. On a directory it means the directory can be entered, without which nobody can reach the files inside. So directories need the execute bit and plain files do not.
Is chmod 777 dangerous?
Usually, yes. It grants write access to every user on the system, so anyone with an account, or any process running as any user, can alter or replace the contents. It is often applied as a shortcut when debugging a permissions problem and then never reverted. The correct fix is almost always to change the owner or group instead.
What is the fourth digit in a mode like 4755?
It holds the special bits: 4 is setuid, 2 is setgid and 1 is the sticky bit. Setuid makes a program run as its owner rather than as the user invoking it, setgid does the same for the group, and the sticky bit on a shared directory stops users deleting each other's files.