Tools › Chmod permissions › chmod 400

chmod 400 explained (r--------)

chmod 400 sets the permissions to r--------.

chmod 400 filename
chmod -R 400 directory/

When to use it

Highly sensitive read-only files such as certificate private keys.

Security note

The owner cannot write to it without first running chmod u+w.

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 640chmod 600chmod 444
Copied to clipboard