Skip to content
BENIBIX Learn

SSH Host Key

Infrastructure🔑 SSH & Remote AccessSSH Basics

Also known as Host Key, Server Fingerprint, Host Key Fingerprint

The key that proves a server is the real one each time you connect.

Think of it like

Think of it like the face of a friend. You know them on sight, so a stranger in a mask stands out.

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.

Definition

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 code

console
$ ssh jack@203.0.113.10
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
The key does not match the saved one. SSH stops before you type a password.
The server shows its host key every time. Your laptop checks it against the one it saved.

Common mistake

Clearing the warning without asking why. Check that the server was really rebuilt before you trust the new key.

Key takeaways

  1. 1
    Proves the server. Not you, the machine.
  2. 2
    Trust once. You accept it on the first login.
  3. 3
    A change is a warning. Find out why first.

Compare

Learn it properly