Linux file permissions and chmod, in plain words
Read rwxr-x--- at a glance, change permissions with chmod in numbers or letters, and fix the classic "Permission denied" on a script or a shared folder.
Checked 2026-11-19Run ls -l and each line starts with something like -rwxr-x---.
Reading the ten characters
- rwx r-x ---
│ │ │ └── everyone else: nothing
│ │ └─────── the group: read and execute
│ └──────────── the owner: read, write, execute
└─────────────── type: - file, d directory, l link
r is read, w is write, x is execute. On a directory they mean something slightly different: r lists the names, w creates and deletes files inside, and x lets you enter it or reach files inside. A folder with r but no x shows names you cannot open.
chmod with numbers
Each of r, w, x is a number (4, 2, 1), added up per group:
| Number | Letters | Typical use |
|---|---|---|
755 | rwxr-xr-x | programs, scripts, public directories |
644 | rw-r--r-- | ordinary files |
700 | rwx------ | a private directory |
600 | rw------- | private keys, .env files |
chmod 600 ~/.ssh/id_ed25519
Try combinations in the chmod calculator.
chmod with letters
chmod u+x deploy.sh # owner may run it
chmod g+w shared/ # the group may add files
chmod o-rwx secrets.txt # nobody else may do anything
chmod -R g+rX project/ # group can read everything, enter every directory
Capital X adds execute only to directories (and files already executable), which is what you want for a whole tree.
Fixing "Permission denied"
ls -l fileandls -ldeach directory on the way: every directory in the path needsxfor you.idshows your user and groups. A group permission helps only if you are in that group, and a new group membership needs a new login.- For a script: it needs
x, or run it asbash script.sh. - Ownership is a different command:
chown user:group file(usually withsudo).