Skip to the content

chmod 700

Only the owner can read, write and execute, or in the case of a directory get in at all. The mode for ~/.ssh and other private directories.

Read (4)Write (2)Execute (1)Digit
Owner7
Group0
Others0

A program runs with the rights of the file's owner.

A program runs with the file's group. In a directory, new files get the directory's group.

In a directory, users can't delete or rename each other's files.

Owner can read, write and execute. Group and others have no access.

chmod 700 file
chmod u=rwx,g=,o= file

Common values

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What 700 allows

WhoDigitOn a fileOn a directory
Owner7 rwxread, change and runlist, enter, add and remove files
Group0 ---nothingnothing
Others0 ---nothingnothing

ls -l shows this mode as -rwx------ on a file and as drwx------ on a directory.

The owner can do everything and nobody else can do anything. On a directory that means others can't even see which files it holds.

Where it belongs

  • ~/.ssh. The directory with your keys is normally 700. The SSH server can refuse to use the authorized_keys file in it when the directory can be written to by others.
  • A private directory. Whatever the modes of the files inside, other accounts can't reach them, because they can't get past the directory.
  • Scripts with something to hide, such as a backup script that contains a password.

Next to 755 and 750

755 lets everyone in to read, 750 only the group, 700 nobody. Home directories show that the choice is a matter of taste: some Linux distributions create them as 755, others as 750 or 700.

A plain file that doesn't have to be executed is better off with 600.

The chmod calculator explains how the digits are built, and what setuid, setgid and the sticky bit add to them.

See all 12