chmod 640

chmod 640 gives rw-r-----. The owner reads and writes, the group reads. Config files a service reads through its group, such as TLS keys readable by ssl-cert.

  • Free
  • No Sign-Up
  • Runs in Your Browser

Owner

Group

Others

Permissions

rw-r-----

Command

chmod 640 file

Chmod Calculator

chmod 640 explained

Octal640
Symbolicrw-r-----
Ownerread, write
Groupread
Othersno access
ls -l Shows-rw-r-----
Commandchmod 640 file
Symbolic Commandchmod u=rw,g=r,o= file

Each digit of 640 is one class of user and adds up read (4), write (2) and execute (1). 6 for the owner is read, write; 4 for the group is read; 0 for the others is no access.

The owner reads and writes, the group reads. Config files a service reads through its group, such as TLS keys readable by ssl-cert.

On a directory, execute means permission to enter it and reach files inside; read means permission to list it. That is why directories usually have execute wherever they have read.

Questions

What does chmod 640 mean?
Owner: read, write. Group: read. Others: no access. In letters: rw-r-----.
Is chmod 640 safe?
Yes, for the uses described here. Nobody outside the classes given write access can change the file.
How do I apply 640 to every directory but not files?
find /path -type d -exec chmod 640 {} + (and use -type f for files only).
How do I set 640 recursively?
chmod -R 640 /path. Be careful: this gives files and directories the same mode, which is rarely what you want; the find command above is safer.

Run servers for other people?

Frabs stops the abuse their VMs send out, and keeps your network off blocklists.