chmod 444
chmod 444 is r--r--r--.
What 444 grants
| Who | Digit | Permissions | Adds up as |
|---|---|---|---|
| Owner | 4 | read | 4 = 4 |
| Group | 4 | read | 4 = 4 |
| Others | 4 | read | 4 = 4 |
When 444 is the right answer
Read-only for everyone. Occasionally used for files that must not be edited by accident, though it does not stop anyone with write access to the containing directory from deleting and replacing the file.
The command
chmod 444 filename
chmod -R 444 directory/
Note that nobody has the execute bit here, so this value cannot be used on a directory that anyone needs to enter. On a directory, execute grants traversal rather than the right to run something.
How it is written elsewhere
| Octal | 444 |
| Symbolic | r--r--r-- |
As a file in ls -l | -r--r--r-- |
As a directory in ls -l | dr--r--r-- |
| Binary | 100 100 100 |
| World-writable | No |
Frequently asked questions
What does chmod 444 mean?
It sets owner to read, group to read, others to read. In symbolic notation that is r--r--r--.
How do I apply 444?
Run chmod 444 filename. Add -R to apply it to a directory and everything inside, though be careful: a recursive numeric chmod marks every file the same way, which is rarely correct for a mixed tree of files and directories.
Is 444 safe?
It grants no write access outside the owner, so it is a reasonable setting as long as the owner is the account you intend.
What is 444 in symbolic notation?
r--r--r--. Written as ls -l shows it, with a leading file-type character, an ordinary file would appear as -r--r--r-- and a directory as dr--r--r--.