Why SSH cares so much
SSH refuses to use private keys, authorized_keys, or even your home directory if permissions are too loose — and the failure mode is silent. Auth quietly falls back to password; you spend hours debugging why your key isn't working. The root cause is almost always permissions. Set them once, audit them periodically, sleep better.
The numbers to memorize
| Path | Permission | Why |
|---|---|---|
~ | 755 or 750 | Not writable by group or others |
~/.ssh | 700 | Only owner can read or list |
~/.ssh/id_ed25519 | 600 | Private key — only owner reads |
~/.ssh/id_ed25519.pub | 644 | Public key, fine to share |
~/.ssh/authorized_keys | 600 | Server-side guest list — only owner writes |
~/.ssh/known_hosts | 644 | Host fingerprints, not secret |
~/.ssh/config | 644 or 600 | Either is fine |