chmod 600 (rw-------)
The owner can read and write; nobody else has access. The standard mode for SSH private keys, .env files and credentials.
rw-------Who can do what
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | – |
| Group | – | – | – |
| Others | – | – | – |
- Owner can read and write.
- Group can nothing.
- Others can nothing.
Commands
Set the mode
chmod 600 my-file # same thing in symbolic form: chmod u=rw,g=,o= my-file
In ls -l output, a file with this mode shows as -rw------- and a directory as drw-------.
Try a different mode
| Read | Write | Execute | Special | |
|---|---|---|---|---|
| Owner | ||||
| Group | ||||
| Others |
Octal Symbolic
Command