chmod 400 (r--------)
Read-only for the owner and no access for anyone else. Used for SSH private keys and AWS .pem key files.
r--------Who can do what
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | – | – |
| Group | – | – | – |
| Others | – | – | – |
- Owner can read.
- Group can nothing.
- Others can nothing.
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
| Read | Write | Execute | Special | |
|---|---|---|---|---|
| Owner | ||||
| Group | ||||
| Others |
Octal Symbolic
Command