chmod 555 — what r-xr-xr-x means
555
r-xr-xr-x
Everyone can read and execute; nobody can write.
Permission breakdown
When to use 555
- Read-only directories that still need to be entered. A directory requires the execute bit to be traversed, so 555 (
r-xr-xr-x) is the read-only counterpart of 755: anyone cancdin and list it, but no one — not even the owner — can add, remove, or rename files inside without restoring write first. - System binaries and shared executables locked against edits. Tools in
/usr/binor/usr/local/binthat every user must run but nobody should modify in place sit comfortably at 555: run-and-read for all, write for none. - Immutable script bundles. A deployed CLI or wrapper script you want runnable by everyone but frozen against accidental edits — 555 keeps the execute bit live while removing every write bit so a careless save fails loudly.
- Read-only mount points and reference trees. Directory trees served read-only (vendored dependencies, content snapshots, a release directory) use 555 dirs so they remain navigable and listable while signalling that the contents are fixed.
Common mistakes & gotchas
- The owner loses write too — that is the point, but it surprises people. Unlike 755, 555 has no
wfor the owner. To modify a 555 file or add to a 555 directory you must firstchmod u+w. If a deploy script suddenly can't write into its own directory, a stray 555 is a common cause. - 555 on a plain data file means it is executable for everyone. The shell will happily try to run it. For non-program files that should just be read, drop the execute bits and use 444 — an executable bit on a text file or image is meaningless noise and can mask mistakes.
- It does not lock the directory's contents from deletion via the parent. As always, whether the directory itself can be removed depends on write permission on its parent. 555 only governs what happens inside this directory, not whether the directory node can be unlinked.
- 555 is world-readable and world-executable — fine for public tools, wrong for secrets. If a script contains embedded credentials, 555 exposes them to every user on the box. Restrict to 550 (owner+group) or 500 (owner only) when the contents are sensitive.
555 vs the alternatives
- 755 (
rwxr-xr-x) is the everyday default — same read/execute for everyone but the owner keeps write. Use 755 for directories and programs you actively maintain; use 555 only when you specifically want even the owner blocked from editing in place. - 444 (
r--r--r--) is 555 without the execute bit. Use 444 for read-only plain data files; use 555 for read-only directories (which need x to be entered) and for executables that must stay runnable. - 550 (
r-xr-x---) removes all access for others. Choose 550 when a read-only directory or executable should be reachable only by the owner and a specific group, and invisible to everyone else on the machine.
Set it with chmod
Apply this permission to a single file:
chmod 555 filename
Or apply it recursively to a directory and everything inside it:
chmod -R 555 directory/
The same thing in symbolic form:
chmod u=rx,g=rx,o=rx filename
Frequently asked questions
What does chmod 555 mean?
chmod 555 sets permissions to r-xr-xr-x: the owner, group, and everyone else can read and execute, but no one can write. It makes a file or directory read-only while keeping it runnable or traversable.
Why use 555 instead of 444 for a directory?
A directory needs the execute (x) bit to be entered and traversed. 444 has no x, so you could not cd into it or reach the files inside. 555 keeps the directory navigable while still forbidding writes.
Can the owner still edit a 555 file?
Not directly — 555 removes write for the owner too. The owner must first restore write with chmod u+w (or chmod 755), make the change, then optionally set it back to 555.
Is chmod 555 safe?
Yes for public directories and executables that should be runnable but not modified. Avoid it for files containing secrets, since 555 is world-readable and any user can read the contents.
Other common permissions
Or build any permission with the interactive chmod calculator.