Skip to content
BENIBIX Learn

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.

Infrastructure🔑 SSH & Remote Access

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.

Example
Jack rebuilds his server, and it gets a new host key. His next login stops with a loud warning until he clears the old key.
Why it matters
It stops a fake server from catching your login. That is the whole point of the warning.
Full entry
Infrastructure🔑 SSH & Remote Access

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.

Example
Lucy makes one key pair on her laptop. She puts the public key on four servers and logs in to all of them with no password.
Why it matters
Keys are far harder to guess than passwords. Most servers should only let keys in.
Full entry

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.