The server's host key changed
Commonknown_hosts holds a key for this host and the server now presents a different one. A server rebuilt or replaced under the same name or address, a cloud instance that got a new IP previously used by another machine, or a provider rotating its keys all do this. So would someone intercepting the connection, which is why SSH refuses rather than decides.
Confirm
ssh-keygen -F <host>
An existing entry for the host. Compare the fingerprint in the warning banner with the one the provider or administrator publishes
Fix
- Confirm the change is legitimate: compare the fingerprint in the warning with the provider's published fingerprints or with what the administrator reads on the server itself.
- Only then remove the stale entry with
ssh-keygen -R <host>. It keeps a backup as known_hosts.old. - Connect again and accept the key at the prompt, checking it matches the fingerprint you confirmed, or add the verified line yourself.
- If the fingerprint does not match anything you can confirm, stop and treat it as a possible interception. Do not connect from that network.
ssh-keyscan -t ed25519 <host> | ssh-keygen -lf - ssh-keygen -R <host> ssh-keyscan -t ed25519 <host> >> ~/.ssh/known_hosts
Run the third line only after the fingerprint printed by the first matches a published or out-of-band one. Reproduced on OpenSSH 10.3 against github.com: the scanned fingerprint matched GitHub's published Ed25519 fingerprint, and the connection then passed host verification.