Where Is the SSH Client Config File?
The SSH client reads ~/.ssh/config with host keys in known_hosts and key pairs beside it.
Last updated
OpenSSH client settings live in a config file inside .ssh in your home directory. Host blocks there set hostnames, users, ports, and identity files per destination. System defaults in /etc/ssh/ssh_config apply underneath.
Known hosts accumulate in known_hosts beside the config with one line per server key. Private keys stay chmod 600 or the client refuses them. First match wins, so put specific hosts above wildcards.
Where OpenSSH stores this, by platform
~/.ssh/config
Host blocks with per destination options live here. Known hosts and keys sit beside it. First obtained value wins per parameter.
~/.ssh/config
Same home folder layout on Mac. Keychain integration options go in Host blocks. System file sits in /etc/ssh underneath.
C:\Users\[username]\.ssh\config
Same file under your profile for OpenSSH builds. Permissions still enforce private key secrecy. Legacy PuTTY sessions stay separate.
Frequently asked questions
Why is my SSH config ignored?
Permissions or an earlier matching block usually cause it. The first value per parameter wins, so order matters. Test with verbose output to see the effective settings.
Where are my SSH keys?
As id_ files in .ssh beside the config, public halves ending in pub. Server keys accumulate in known_hosts. Back up private keys offline.
Notice an outdated path? Let us know.