Error Codes Wiki

SSH Key Permission Errors — Too Open Permissions and Key Authentication Failures

Warningnetwork

Overview

Fix SSH key errors including 'Permissions are too open', key rejected by server, agent forwarding failures, and authorized_keys configuration issues.

Key Details

  • SSH requires strict permissions on key files: private key must be 600, .ssh directory must be 700
  • 'Permissions 0644 for key are too open' means the private key is readable by others
  • Server checks ~/.ssh/authorized_keys for public keys — file must be owned by the user with mode 600 or 644
  • SSH agent (ssh-agent) caches unlocked keys so you don't re-enter passphrases
  • Agent forwarding (-A) allows using local keys on remote servers (security risk on untrusted servers)

Common Causes

  • Private key file permissions too permissive (should be 600, not 644 or 777)
  • .ssh directory permissions wrong (should be 700)
  • authorized_keys file owned by wrong user or wrong permissions on the server
  • Key type not accepted by server (some servers disable RSA or require ed25519)
  • Home directory permissions on server too open (sshd checks home dir permissions)

Steps

  1. 1Fix private key permissions: chmod 600 ~/.ssh/id_rsa (or id_ed25519)
  2. 2Fix .ssh directory: chmod 700 ~/.ssh
  3. 3Fix authorized_keys on server: chmod 600 ~/.ssh/authorized_keys && chown user:user ~/.ssh/authorized_keys
  4. 4Copy key to server: ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
  5. 5Debug connection: ssh -vvv user@server to see detailed authentication log
  6. 6Generate new key: ssh-keygen -t ed25519 -C 'your@email.com' (ed25519 is recommended over RSA)

Tags

sshkey-permissionsauthorized-keysauthenticationed25519

Related Items

More in Network

Frequently Asked Questions

SSH fails silently for security. Use ssh -vvv to see why. Common causes: wrong permissions on server's .ssh/ or authorized_keys, home directory writable by group, or key type not accepted.