Tools › Chmod permissions › chmod 640

chmod 640 explained (rw-r-----)

chmod 640 sets the permissions to rw-r-----.

chmod 640 filename
chmod -R 640 directory/

When to use it

Config files containing credentials that a service group needs to read.

Security note

Make sure the file's group is the service's group, otherwise the service cannot read it.

Tip: applying it to files and directories separately

Directories need the execute bit to be entered, files usually do not. Set them separately: find dir -type d -exec chmod 755 {} + and find dir -type f -exec chmod 644 {} +.

Other common modes

chmod 777chmod 775chmod 755chmod 750chmod 700chmod 666chmod 664chmod 644chmod 600chmod 444chmod 400
Copied to clipboard