SSH Host Key vs SSH Key Pair
People think the host key is their own SSH key, and it is not. The host key belongs to the server. It proves to your laptop that it reached the real server, and its copy lives in known_hosts. Your key pair belongs to you. It proves to the server who you are, and its public half lives in authorized_keys.
SSH Host Key
The key that proves a server is the real one each time you connect.
A host key is the key that proves a server is the one you think it is. Each server makes its own when SSH is installed. On your first login, your computer is shown its short fingerprint and asked to trust it. After that, your computer checks the key every time. If it ever changes, SSH stops and warns you.
SSH Key Pair
Two matching keys for SSH. You keep the private one and share the public one.
An SSH key pair is two matching keys used to log in without a password. The private key stays on your computer and is never shared. The public key is a copy you put on each server. What the private key signs, only the public key can check. So the server knows it is you without ever seeing your secret.
In one line
- SSH Host Key
- The key that proves a server is the real one each time you connect.
- SSH Key Pair
- Two matching keys for SSH. You keep the private one and share the public one.