# WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! (ssh host key changed)

**Code:** `REMOTE HOST IDENTIFICATION HAS CHANGED` · **Category:** Linux · **Seen on:** Linux

The server’s SSH host key differs from the one saved in ~/.ssh/known_hosts — usually because the server was rebuilt or the IP was reused.

## Meaning

SSH protects you from man-in-the-middle attacks by pinning host keys. Rebuilt VMs, reused cloud IPs, or reinstalling the OS change the key. If you didn’t expect a change, verify with the server owner before trusting it.

## Common causes

- Server reinstalled/rebuilt or new VM on the same IP
- Load balancer/DNS pointing to a different host
- Genuine man-in-the-middle (rare — verify)

## Quick fix

1. Confirm the change is expected
2. Remove the old key: ssh-keygen -R host
3. Reconnect and accept the new fingerprint (verify it out of band)

## Detailed fix by platform

### Shell

1. 

```bash
ssh-keygen -R 203.0.113.10
ssh-keygen -R example.com
ssh user@example.com
```


## How to diagnose

1. **Expected** — Was the server rebuilt?
2. **Fingerprint** — Compare with the server console (ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub)

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/linux/remote-host-identification-has-changed)
