Frequently Asked Question
Host Verification Fails
Last Updated 7 years ago
Your project may use the same floating IP for different VMs. It is possible that moving the IP from one VM to another will cause you to get the following error message:
This happens because your computer records an identification key each time it connects to a new host. Remember this prompt?
Your computer recorded a key from the first VM and associated it with the IP address. Since it received a different key this time, it refuses to connect. If this happened unexpectedly, we might be worried that our VM was compromised in some way. But in this case, we know we just changed which VM the IP address is pointing to, so it’s OK. We just need to remove the old host key.
Open the file
Just delete the entire line. Try the ssh connection again. You should get the
This happens because your computer records an identification key each time it connects to a new host. Remember this prompt?
Your computer recorded a key from the first VM and associated it with the IP address. Since it received a different key this time, it refuses to connect. If this happened unexpectedly, we might be worried that our VM was compromised in some way. But in this case, we know we just changed which VM the IP address is pointing to, so it’s OK. We just need to remove the old host key.
Open the file
~/.ssh/known_hosts
in your favorite text editor. Find the line starting with the IP address of your VM. It should look something like this:129.10.3.66 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAy NTYAAABBBNAdpmhHLWgwwiUf8nU4xr9G1HUvbsWMoVpyUMgcg64Foh5hUCYTX6VvxZdPO2S+fGZ2abtoz1LCkeEy3mAck0k=
Just delete the entire line. Try the ssh connection again. You should get the
are you sure you want to connect
prompt. Your computer will record the new host key.