chmod 555: Read and Execute With No Write for Anyone
555 is r-xr-xr-x: all three classes can read and execute, and nobody has write permission, including the owner. It guards against accidental modification rather than against a determined one, because the owner can always put the write bit back.
At a glance
- Octal
- 555, written 0555 in four digit form
- Symbolic
- u=rx,g=rx,o=rx
- On a file
- -r-xr-xr-x
- On a directory
- dr-xr-xr-x
- Owner
- Read and execute. No write, so an edit in place is refused
- Group
- Read and execute
- Others
- Read and execute. On a directory: list and enter, but nothing can be created
In detail
555 is 755 with the owner's write bit removed. The practical effect is that an editor cannot save over the file and a script cannot overwrite it without first changing the mode. On a directory it means nobody can create, rename or delete an entry, so the set of names inside is frozen while the contents of each file follow their own modes.
That makes it useful as a guard rail. Mount points that should stay empty, vendor supplied trees that a package manager owns, and directories that a deployment must never write into are all reasonable candidates. It converts a class of silent mistakes into an immediate and obvious permission denied.
It is not immutability. The owner and root can run chmod at any time, because the right to change a mode comes from ownership, not from the mode itself. Real immutability on Linux is the file attribute set with chattr +i, which even root must clear before writing, or a read only mount, which applies to the whole file system.
The friction shows up in ordinary tooling. Many editors refuse to save and offer to force, git checkout can fail to overwrite a 555 file, and rm asks for confirmation before removing a write protected file even though the removal itself is permitted by the directory. That last one surprises people: deleting a file is governed by write permission on its directory, not on the file.
Its restrictive sibling is 550, which keeps read and execute for the owner and the group and refuses everything to others. Choose 555 when the content is genuinely public on the machine, and 550 when only a specific service group should be able to run or read it.
Examples
chmod 555 /opt/vendor/bin/agent
chmod u=rx,g=rx,o=rx /opt/vendor/bin/agentdr-xr-xr-x 2 root root /opt/vendor/conf/
$ touch /opt/vendor/conf/new.cfg
touch: cannot touch: Permission denied
Existing files can still be edited if their own mode allows
it. The directory mode controls the list of names, not the
contents of the files.# a guard rail: the owner can undo it
chmod 555 important.conf
chmod 644 important.conf # works
# actual immutability: root must clear the flag first
chattr +i important.conf
chmod 644 important.conf # Operation not permittedThings that catch people out
- 555 does not stop the owner. It stops an accident. Anyone who can run chmod on the file can undo it in one command.
- A 555 file can still be deleted if its directory is writable, because removal is a directory operation. rm prompts about the write protected file and then removes it anyway.
- Package managers and deploy tools that expect to overwrite a file will fail against 555, and the failure often surfaces late, during an upgrade rather than during the change that set the mode.
- 555 on a directory freezes the names inside but not the file contents. To make the contents read only too, set 444 or 555 on the files as well.
Try it: Chmod Calculator
Tick the nine permission boxes, or type an octal or symbolic value, and get the three digit and four digit octal, the ls -l rendering and the exact chmod command back.
Chmod Calculator
LOCAL · Browser-OnlyCalculate Unix file permissions with an interactive chmod builder
Permission Matrix
| Entity | Read (4) | Write (2) | Execute (1) | Octal | Symbolic |
|---|---|---|---|---|---|
| Owner (u) | 7 | rwx | |||
| Group (g) | 5 | r-x | |||
| Others (o) | 5 | r-x |
Special Bits
Advanced permission flags for executables and directories
Generated Permissions
755rwxr-xr-x-rwxr-xr-xchmod 755 filenamechmod u=rwx,g=rx,o=rx filenamePermission Breakdown
Owner (u)
7rwx- - Read files / list directory contents
- - Write / modify / delete
- - Execute / traverse directory
Group (g)
5r-x- - Read files / list directory contents
- - Execute / traverse directory
Others (o)
5r-x- - Read files / list directory contents
- - Execute / traverse directory
Common Permissions Reference
| Octal | Symbolic | Meaning |
|---|---|---|
777 | rwxrwxrwx | Full access for everyone |
755 | rwxr-xr-x | Owner full, others read and execute |
750 | rwxr-x--- | Owner full, group read and execute |
700 | rwx------ | Owner full access only |
666 | rw-rw-rw- | Read and write for everyone |
644 | rw-r--r-- | Owner read/write, others read only |
600 | rw------- | Owner read/write only |
555 | r-xr-xr-x | Read and execute for everyone |
444 | r--r--r-- | Read only for everyone |
400 | r-------- | Owner read only |
Related File permissions
All file permissions →chmod 550: Programs a Service Can Run but Cannot Change
550 gives the owner and group read and execute and everyone else nothing. The mode for a privileged script that a service must run but must not modify.
chmod 444: Read Only for Everyone, With Real Limits
444 gives read to all three classes and write to none, not even the owner. Why a 444 file can still be deleted and what actually makes a file immutable.
chmod 755: The Standard Mode for Directories and Programs
755 gives the owner full control and everyone else read and execute. Why it is right for directories and executables and wrong for ordinary data files.
chmod 500: Owner Only Read and Execute, Nothing Else
500 lets the owner read and execute but not write, and gives group and others nothing. A guard against accidental edits and a way to freeze a directory.
chmod 440: Read Only for Owner and Group, the sudoers Mode
440 gives the owner and group read only and everyone else nothing. Why sudo refuses to run unless its configuration files carry exactly this mode.
chmod 400: Read Only Keys and Downloaded PEM Files
400 gives the owner read and nothing to anyone else, not even write. The usual mode for a downloaded cloud key pair and how it differs from 600.
Tools for this
- Chmod Calculator Free online chmod calculator - calculate Unix file permissions with an interactive chmod builder