File permissions · modechmod 700rwx------

What chmod 700 (rwx------) means, who is allowed to do what, and when these permissions are used: a private directory for the owner only: ~/.ssh, ~/.gnupg.

Open in the calculator
Class by classdirectory
7
Owner
List the files, create and delete files, enter it.
0
Group
No rights at all — no access.
0
Others
No rights at all — no access.
When and why

Outsiders can neither enter nor list it. The counterpart to 600: the key itself 600, the directory around it 700.

Mode
Octal700
Symbolicrwx------
ls -l linedrwx------
Command
chmod 700 directory
01

What breaks

«Bad owner or permissions» and an unsafe homedir

Bad owner or permissions on /home/user/.ssh/config

ssh will not read the config when the directory is open to others, and the connection ignores every setting in it. gpg says the same in its own words: «unsafe permissions on homedir». A directory holding secrets must be 700, even when the files inside are already 600.

02

Easily confused with

750rwxr-x---

the group does enter and read — right for a team directory, not for ~/.ssh.

chmod 750
755rwxr-xr-x

everyone enters: not suitable for a home directory holding keys.

chmod 755
600rw-------

the same, but for a file: a directory without `x` cannot be entered at all.

chmod 600
03

Commands for this case

chmod 700 ~/.ssh ~/.gnupg

close both secret directories at once

chmod 700 ~/private && chmod 600 ~/private/*

the directory and its contents: neither protects without the other

Work out other permissions

The calculator opens on this mode: checkboxes, octal and symbolic notation, an ls -l line and the ready command.

Open the calculator on this modeAll common modes

Updated

«» added to favorites