# SSH Host Key

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

**Field:** Infrastructure  
**Category:** SSH & Remote Access  
**Also known as:** Host Key, Server Fingerprint, Host Key Fingerprint

## 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.

## 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

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.

## 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.

## Why it matters

It stops a fake server from catching your login. That is the whole point of the warning.

## Common mistake

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

## Three principles

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

## Related terms

- [known_hosts](https://learn.benibix.com/term/infrastructure/known-hosts)
- [Secure Shell (SSH)](https://learn.benibix.com/term/infrastructure/ssh)
- [SSH Server (sshd)](https://learn.benibix.com/term/infrastructure/ssh-server)
- [SSH Key Pair](https://learn.benibix.com/term/infrastructure/ssh-key-pair)

## Told apart from

- [SSH Host Key vs SSH Key Pair](https://learn.benibix.com/compare/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.

## Taught in

- [SSH Host Keys and known_hosts](https://learn.benibix.com/learn/infrastructure-ssh/ssh-host-keys-and-known-hosts): SSH, 2/9

![Three rows. First visit: the server shows its host key and the laptop saves it in known_hosts. Later visit: the server shows the same key, it matches the saved one and the login goes on. Changed key: the key does not match, and the laptop stops with a warning that the host may not be the real one.](https://learn.benibix.com/diagrams/inf3-host-key.svg)

---

Source: https://learn.benibix.com/term/infrastructure/host-key
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
