Toolman

chmod 400

chmod 400 is r--------.

What 400 grants

WhoDigitPermissionsAdds up as
Owner4read4 = 4
Group0no access0
Others0no access0

When 400 is the right answer

Read-only for the owner and nothing for anyone else. This is what an SSH private key should be, and OpenSSH will refuse to use a key file that is more permissive.

The command

chmod 400 filename
chmod -R 400 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

Octal400
Symbolicr--------
As a file in ls -l-r--------
As a directory in ls -ldr--------
Binary100 000 000
World-writableNo

Frequently asked questions

What does chmod 400 mean?

It sets owner to read, group to no access, others to no access. In symbolic notation that is r--------.

How do I apply 400?

Run chmod 400 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 400 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 400 in symbolic notation?

r--------. Written as ls -l shows it, with a leading file-type character, an ordinary file would appear as -r-------- and a directory as dr--------.

Other permission values

All permission values · Chmod calculator