Guide

chmod permissions explained: what 755, 644 and 777 mean

Reviewed 22 November 2026 · 6 min read · Written and maintained by Toolnexo

Few commands cause as much copy-and-paste anxiety as chmod. The permission numbers look arbitrary until you see that each digit is built from three simple values. This guide explains how those digits are formed, which modes are sensible for files and directories, why 777 is rarely the answer, and what the extra setuid, setgid and sticky bits do. The chmod calculator on this site builds the number from checkboxes and shows the symbolic form, and it never touches your files. It only produces the command.

Three classes, three permissions

Every file has permissions for three classes of user: the owner, the owner's group, and everyone else (others). Each class can have read (r), write (w) and execute (x). In a long listing these appear as nine characters, for example rwxr-xr-x: the first three are the owner's, the next three the group's, the last three everyone else's.

In octal, read is worth 4, write 2 and execute 1, and a digit is the sum for one class. So rwx is 7, r-x is 5 and r-- is 4. The mode rwxr-xr-x is therefore 755, and rw-r--r-- is 644.

The modes you will actually use

  • 644 (rw-r--r--): ordinary files. The owner can edit, everyone else can read.
  • 755 (rwxr-xr-x): scripts, programs and directories. Everyone can read and run, only the owner can change.
  • 600 (rw-------): private files such as SSH private keys, which many tools refuse to use if others can read them.
  • 700 (rwx------): private directories.
  • 664 and 775: group-writable variants for shared project folders.

What execute means on a directory

On a file, execute lets you run it as a program. On a directory, it means permission to enter it and reach the files inside by name. Read on a directory lets you list its contents. That is why directories usually need 755 or 700: a directory with read but no execute shows its names but you cannot open anything in it.

Why 777 is a red flag

777 gives everyone on the system (every user and every service) permission to read, change and run the file. It is a common quick fix for a permission error, but it removes the protection permissions exist for, and on a web server it can let a compromised account alter your code. If something fails with a safer mode, find which user actually needs access and change the owner or group instead.

Setuid, setgid and the sticky bit

A fourth leading digit adds three special bits. Setuid (4) makes an executable run with its owner's privileges, which is how tools like passwd can update protected files. Setgid (2) does the same for the group and, on a directory, makes new files inherit the directory's group. The sticky bit (1) on a directory means only a file's owner can delete or rename it, even if others can write to the directory. This is how /tmp works, with mode 1777.

These bits are powerful. A setuid program owned by root that can be tricked into running arbitrary commands is a classic privilege-escalation route, so only use setuid on code you trust completely.

Defaults and the umask

New files normally start from 666 and new directories from 777, with a umask removing bits. A common umask of 022 strips write for group and others, giving 644 files and 755 directories, which is why those two numbers are everywhere.

Tools in this guide

Put it into practice

How this guide is maintained

This page is reviewed when the related tools change. It describes what the published tools actually do: the tools run in your browser tab, so your files stay on your device. If you find something inaccurate, email [email protected] and it will be corrected.

Keep reading

Other guides

All guides →