Home·File permissions

125 chmod permission modes

What 755 and 644 actually open up, and which umask produces them — all worked out from the three digits.

The ones you actually type

Of the 125, about ten are the ones your fingers actually reach for.

All 125

Every combination of the five values that actually get used — 0, 4, 5, 6, 7. Write-without-read and the like are left out.

Owner 0 — 0xx---

Owner 4 — 4xxr--

Owner 5 — 5xxr-x

Owner 6 — 6xxrw-

Owner 7 — 7xxrwx

How to read this

  • Read is 4, write 2, execute 1; add them for one digit. 7 is 4+2+1, 5 is 4+1.
  • The digits are owner, group, others, left to right.
  • umask is what gets taken away: from 777 for directories, from 666 for files.
  • Special bits (setuid 4000, setgid 2000, sticky 1000) add a fourth digit in front — /tmp is 1777.

Frequently asked questions

Q. What is the difference between 755 and 644?

One execute bit. 755 lets anyone run the file or step into the folder; 644 is read-only for others. Folders get 755, ordinary files 644.

Q. Why not just use 777?

Because anyone who reaches the machine can then change the contents. Opening 777 to get past a permission error is taking the door off its hinges.

Q. What does umask 022 mean?

It is what gets subtracted. Directories start at 777 and become 755; files start at 666 and become 644.

Q. What is 1777, with four digits?

The leading digit is the special bits. The 1 is the sticky bit: on /tmp everyone may write, but nobody may delete another’s files.

Q. What does execute mean on a folder?

The right to go inside. With read alone you can list the names but open nothing within.