REMOTE HOST IDENTIFICATION HAS CHANGED 🐧 Linux

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

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.

Seen on: Linux

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)

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.