LazyTools

🔒 Every tool runs in your browser — the files and values you enter are never uploaded to any server. How it works

explainer

chmod 755 Explained: Unix File Permissions Without the Guesswork

By the LazyTools team · Published 2026-07-10 · Updated 2026-07-10 · 4 min read

chmod 755 explained — Unix file permissions and the octal numbers

chmod 755 sets rwxr-xr-x — full control for the owner, read-and-execute for everyone else — and once you know that each digit is just read (4) + write (2) + execute (1) added up, every chmod number reads itself. Build any permission by clicking the read/write/execute boxes, or type a number and see what it grants, with the chmod calculator; here’s the whole system in five minutes.

The number is a sum

Unix gives every file three sets of permissions — for the owner, the group, and others (everyone else) — and each set has three bits: read, write, execute. The chmod number encodes them with a simple trick: read is worth 4, write 2, execute 1, and each digit is whatever you add up.

Infographic: read equals 4, write equals 2, execute equals 1, and each chmod digit is their sum; 7 is rwx, 5 is r-x, 6 is rw-, 4 is r--, 0 is none; chmod 755 breaks into 7 for the owner (rwx), 5 for group (r-x) and 5 for others (r-x), shown as -rwxr-xr-x in ls -l; common values are 644 for files, 755 for directories and programs, 600 for private files, and 777 world-writable to avoid; on a directory execute means enter not run, and 'only works with 777' usually means the real fix is chown
Every chmod number is read+write+execute, summed per user class.

So the digit tells you the permissions at a glance:

DigitBitsMeaning
74+2+1rwx — read, write, execute
64+2rw- — read, write
54+1r-x — read, execute
44r— — read only
0--- — no access

Read chmod 755 left to right: owner 7 (rwx), group 5 (r-x), others 5 (r-x) → -rwxr-xr-x, which is exactly what ls -l prints. The calculator converts both ways live — tick the boxes to get the number, or type the number to light up the boxes.

The values you’ll actually type

In practice a handful of modes cover almost everything:

  • 644 (rw-r—r—) — ordinary files: documents, images, HTML, config. Owner can edit; everyone can read; nobody executes. The sensible default for content.
  • 755 (rwxr-xr-x) — directories and executables. Owner has full control; others can read and execute. Directories need the execute bit — on a directory, “execute” means permission to enter it and access what’s inside, not “run it as a program”.
  • 600 (rw-------) — private files. Only the owner can read or write; nobody else sees it. This is mandatory for SSH private keysssh refuses to use a key file that others can read.
  • 700 (rwx------) — a private directory, entering and listing restricted to the owner.

Why chmod 777 is a red flag

777 grants read, write and execute to everyone — the file is now world-writable. It’s the classic “just make it work” move, and it’s almost always wrong:

  • On any shared host, world-writable means any other account — including a compromised one — can overwrite your file. It’s a genuine security hole, and it’s why web servers and many tools refuse to run scripts that are group- or world-writable.
  • When something “only works with 777”, the actual problem is usually ownership, not permissions. The web server runs as a different user than the one who uploaded the files, so the right fix is chown (change the owner to the service account) with a tight mode like 644/755, not opening the file to the entire machine.

If you’re reaching for 777, pause and ask who needs access — the answer is usually one specific user or group, which chown/chgrp plus 644/755 handles cleanly.

The fourth digit: setuid, setgid, sticky

chmod modes sometimes have a leading fourth digit for special bits:

  • Setuid (4) — an executable runs with the permissions of its owner, not the user launching it. passwd uses this so ordinary users can update the root-owned password file. 4755 is 755 plus setuid.
  • Setgid (2) — runs as the file’s group; on a directory, new files inside inherit that group, which is handy for shared project folders.
  • Sticky bit (1) — on a shared-writable directory like /tmp (mode 1777), it restricts deletion so only a file’s owner can remove it, even though everyone can write there.

These are powerful and occasionally dangerous (a setuid-root binary with a bug is a privilege escalation), so use them deliberately. The chmod calculator includes the special bits and shows how, say, 4755 differs from 755 in the symbolic string (the x becomes s).

Quick summary

chmod permissions are three sets — owner, group, others — of read (4), write (2), execute (1), summed into each digit. 755 (rwxr-xr-x) is the norm for directories and programs, 644 for files, 600 for private keys; the execute bit on a directory means “enter”, not “run”. Treat 777 as a warning sign that the real fix is ownership. Convert any mode both ways, special bits included, with the chmod calculator — and while you’re automating server tasks, the cron expression parser does the same demystifying for schedules.

Sources: GNU coreutils — chmod manual · Linux man-pages — chmod(1) and chmod(2) · Filesystem Hierarchy Standard.

Frequently asked questions

What does chmod 755 mean?

It sets read+write+execute for the owner (7 = 4+2+1), and read+execute for the group and everyone else (5 = 4+1). In symbolic form that's rwxr-xr-x. It's the standard permission for directories and for programs that others may run but not modify.

How do the chmod numbers work?

Each of the three digits is a sum of three permission bits: read = 4, write = 2, execute = 1. So 7 is all three (rwx), 6 is read+write (rw-), 5 is read+execute (r-x), 4 is read only (r--), 0 is none. The three digits set permissions for owner, group and others in that order.

What's the difference between 644 and 755?

644 (rw-r--r--) has no execute bit — right for ordinary files like documents, images and config. 755 (rwxr-xr-x) adds execute for everyone — needed for programs and for directories, where the execute bit means 'permission to enter the directory', not 'permission to run it'.

What does chmod 777 do, and should I use it?

777 grants read, write and execute to everyone — the file becomes world-writable. It's almost always the wrong fix: on a shared server it lets any other account modify your file, and 'it only works with 777' usually means the real problem is ownership, solved with chown rather than loosening permissions for all.

When should I use chmod 600?

For private files that only the owner should read or write, with no access for anyone else — most importantly SSH private keys, which SSH refuses to use if they're readable by others. 600 is rw------- : read+write for you, nothing for group or others.

What are the setuid, setgid and sticky bits?

An optional fourth leading digit. Setuid (4) runs an executable as its owner; setgid (2) runs it as its group, and on a directory makes new files inherit that group. The sticky bit (1) on a shared directory like /tmp (mode 1777) lets only a file's owner delete it. So 4755 is 755 plus setuid.