640
Octal
rw-r-----
Symbolic
Safe
Security
What does chmod 640 mean?
chmod 640 gives owner read/write, group read. The owner edits the file and a group (for example the web server’s group) can read it; others get nothing. A good choice for config files with credentials that a service running as another user must read.
| Who | Digit | Symbolic | Permissions |
|---|---|---|---|
| Owner (user) | 6 | rw- | read, write |
| Group | 4 | r-- | read |
| Others | 0 | --- | no access |
Each digit is the sum of read (4), write (2) and execute (1). In ls -l the file shows as -rw-r-----.
How to use chmod 640
# one file or directory
chmod 640 filename
# the same permissions in symbolic form
chmod u=rw,g=r,o= filename
# a directory and everything inside it
chmod -R 640 directory/
# only regular files
find path/ -type f -exec chmod 640 {} +
Need a different combination? Tick the boxes in the chmod calculator to get the octal and symbolic values instantly.
Chmod calculatorToggle read, write and execute for owner, group and others to build any permission.
Open the calculator Frequently asked questions
What does chmod 640 do?
It sets the permissions to rw-r-----: the owner gets read, write, the group read and others no access.
What is 640 in symbolic notation?
rw-r-----, or chmod u=rw,g=r,o= as a symbolic chmod command.Is chmod 640 safe?
Yes, 640 does not give write access to other users.