Where Are SSH Keys Stored?
Default .ssh folder on Windows, macOS and Linux, with private keys, known_hosts, config and the permissions SSH enforces.
Last updated
OpenSSH keeps keys, host records and client config in .ssh inside your home folder on every OS. Only the home prefix changes.
Permissions are load bearing, not cosmetic. A private key readable by others gets refused, so keep the folder at 700 and private keys at 600.
Where SSH stores this, by platform
%USERPROFILE%\.ssh
Usually C:\Users\[Name]\.ssh with id_ed25519 plus .pub, known_hosts and config. Windows 10 1809 and later ship OpenSSH, so ssh-keygen works in PowerShell.
~/.ssh
Default Ed25519 pair is id_ed25519 plus id_ed25519.pub. Older setups use id_rsa pairs instead. Copy the .pub text with pbcopy for pasting into dashboards.
~/.ssh
Same layout. authorized_keys here controls logins to this account; config holds per host shortcuts and IdentityFile picks.
Frequently asked questions
SSH rejects my key with UNPROTECTED PRIVATE KEY FILE. What now?
Tighten permissions: folder to 700, private key and authorized_keys to 600, public keys and known_hosts to 644. Then retry the connection.
Which file do I paste into GitHub?
The .pub file contents. The private half never leaves the machine it was generated on.
Notice an outdated path? Let us know.