Kitloft

All tools / chmod reference

chmod 400 (r--------)

Read-only for the owner and no access for anyone else. Used for SSH private keys and AWS .pem key files.

chmod 400 in symbolic form
r--------

Who can do what

ReadWriteExecute
Owner✓––
Group–––
Others–––

Commands

Set the mode
chmod 400 my-file
# same thing in symbolic form:
chmod u=r,g=,o= my-file

In ls -l output, a file with this mode shows as -r-------- and a directory as dr--------.

Try a different mode

ReadWriteExecuteSpecial
Owner
Group
Others
Octal Symbolic
Command