Skip to content

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-19

Run 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:

NumberLettersTypical use
755rwxr-xr-xprograms, scripts, public directories
644rw-r--r--ordinary files
700rwx------a private directory
600rw-------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"

  1. ls -l file and ls -ld each directory on the way: every directory in the path needs x for you.
  2. id shows your user and groups. A group permission helps only if you are in that group, and a new group membership needs a new login.
  3. For a script: it needs x, or run it as bash script.sh.
  4. Ownership is a different command: chown user:group file (usually with sudo).
Practise it on a real machineFiles, Permissions & Ownership lab
Open the lab