chmod 640 (rw-r-----)
The owner can read and write and the group can read. Common for config files a service reads through its group.
rw-r-----Who can do what
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | – |
| Group | ✓ | – | – |
| Others | – | – | – |
- Owner can read and write.
- Group can read.
- Others can nothing.
Commands
Set the mode
chmod 640 my-file # same thing in symbolic form: chmod u=rw,g=r,o= my-file
In ls -l output, a file with this mode shows as -rw-r----- and a directory as drw-r-----.
Try a different mode
| Read | Write | Execute | Special | |
|---|---|---|---|---|
| Owner | ||||
| Group | ||||
| Others |
Octal Symbolic
Command