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

The owner can read; the group has no access; others have no access.

Octal
400
Symbolic
r--------
ls -l shows
-r--------

Who can do what

Class Read (4) Write (2) Execute (1) On a directory
Owner (u)YesNoNoList the file names, but not open them.
Group (g)NoNoNoNo access.
Others (o)NoNoNoNo access.

When to use chmod 400

Lets only the owner read, and nobody write or execute.

The strictest mode that still lets the owner use the file. Common for private keys, such as AWS .pem key files, which ssh accepts with 400 or 600.

Commands

Set the mode with octal digits, or with the equivalent symbolic form:

chmod 400 path/to/file
chmod u=r,g=,o= path/to/file

To apply it to every directory below a folder (and not to the files), combine it with find:

find path/to/folder -type d -exec chmod 400 {} +

chmod -R 400 changes files and directories alike, which is rarely what you want: directories usually need execute, regular files usually should not have it.

Work out any mode in the Chmod Calculator