chmod 444: Read Only for Everyone, With Real Limits
444 is r--r--r--: every class can read, no class can write, and nothing is executable. It marks a file as reference material, and it does not prevent deletion, because removing a file is governed by the directory rather than the file.
At a glance
- Octal
- 444, written 0444 in four digit form
- Symbolic
- u=r,g=r,o=r
- On a file
- -r--r--r--
- On a directory
- dr--r--r--, listable but impossible to enter
- Owner
- Read only. Cannot save over the file without changing the mode first
- Group
- Read only
- Others
- Read only. Every local account can read the contents
In detail
444 says this file is finished. Reference data, a generated file that a build produces and nothing should hand edit, a licence text, a checked in artefact: making it unwritable turns an accidental save into a visible error. Editors report that the file is read only, which is a far better outcome than a silent overwrite discovered three commits later.
The limit that catches people is deletion. Removing a file requires write permission on the directory that contains it, not on the file, so a 444 file in a writable directory can be deleted by anyone who could delete a 644 one. Interactive rm asks for confirmation about a write protected file, and rm -f does not ask at all.
It is also not immutability. The owner can chmod it back to 644 in a single command, and root can do so to anything. If a file must resist a deliberate change, use chattr +i, which even root has to clear before writing, or place it on a read only mount where the file system itself refuses.
On a directory 444 is a curiosity worth understanding: the read bit lets you list the names, and the missing execute bit means you cannot stat any of them or enter the directory. The result is a listing where every entry shows as unknown, which is the clearest possible demonstration that read and execute are separate permissions.
For most read only needs, 444 is more than required. If only the owner and a service group should see the file, 440 is the narrower version, and it is what tools such as sudo require of their own configuration. Choose 444 when the content is genuinely public on the machine.
Examples
chmod 444 generated-schema.json
chmod u=r,g=r,o=r generated-schema.json-r--r--r-- 1 alice alice notes.txt
drwxr-xr-x 2 alice alice . # the directory is writable
$ rm notes.txt
rm: remove write-protected regular file 'notes.txt'? y
$ ls notes.txt
ls: cannot access 'notes.txt': No such file or directorydr--r--r-- 2 alice alice frozen/
$ ls frozen
a.txt b.txt
$ ls -l frozen
ls: cannot access 'frozen/a.txt': Permission denied
-????????? ? ? ? ? ? a.txt
$ cd frozen
bash: cd: frozen: Permission deniedThings that catch people out
- A 444 file in a writable directory is trivially deletable. The mode protects the contents from being rewritten in place and nothing else.
- Version control and package tooling frequently need to replace a file rather than edit it, which succeeds against 444 and defeats the intent. Do not rely on the mode to survive an update.
- 444 on a directory produces a listing full of question marks, because stat needs the execute bit. It is a common source of confusing bug reports.
- Every local account can read a 444 file. It is a write protection, not a confidentiality measure, so it is the wrong mode for anything sensitive.
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 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.
chmod 555: Read and Execute With No Write for Anyone
555 removes the write bit from the owner as well as everyone else. What that protects against, what it does not, and how real immutability is done.
chmod 644: The Default File Mode and When to Change It
644 gives the owner read and write and everyone else read only. Why it is the default for files under a 022 umask, and the cases where it is wrong.
chmod 070: Group Only Access and the First Match Rule
070 grants the group everything and the owner nothing. The owner really is denied, because the kernel checks one class only, and this mode proves it.
chmod 007: Everyone Else Gets Everything, the Owner Gets Nothing
007 gives every other account full access while locking out the owner and the group. Almost always a typo for 700, and a lesson in how chmod is authorised.
Tools for this
- Chmod Calculator Free online chmod calculator - calculate Unix file permissions with an interactive chmod builder