Chmod 700 for .ssh Directory

Learn why chmod 700 is required for the ~/.ssh directory. SSH enforces strict directory permissions for security.

Permission

700

rwx------

chmod 700 filename

Permission Breakdown

RoleRead (4)Write (2)Execute (1)OctalMeaning
Ownerrwx7read, write, execute
Group---0no permissions
Others---0no permissions

Visual Permission Grid

Read
Write
Execute
Owner
r
w
e
Group
-
-
-
Others
-
-
-

Detailed Explanation

The permission 700 is the required permission for the ~/.ssh directory. The SSH client checks directory permissions as part of its security validation.

Octal breakdown:

  • 7 (Owner): read (4) + write (2) + execute (1) = full access
  • 0 (Group): no access
  • 0 (Others): no access

In symbolic notation this is rwx------.

The ~/.ssh directory contains your most sensitive authentication material: private keys, known hosts, authorized keys, and SSH configuration. If this directory is accessible by other users, an attacker with local access could:

  1. Read your private keys and impersonate you
  2. Modify your authorized_keys to grant themselves access
  3. Tamper with known_hosts to enable man-in-the-middle attacks
  4. Read your SSH config to discover servers you connect to

The SSH client enforces that ~/.ssh is 700 (or 755 in some configurations, but 700 is recommended). If the directory has incorrect permissions, SSH may refuse to read its contents, breaking key-based authentication.

After creating the directory or fixing permissions, run: chmod 700 ~/.ssh

Use Case

Required for the ~/.ssh directory on all Unix/Linux/macOS systems. SSH validates this permission as part of its strict security checks for key-based authentication.

Try It — Interactive Calculator

Customize this permission →