SSH WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

My cloud server moved to VPC from classic network just now, and connecting to it via SSH got following error

 

Solution

It seems the server host key is changed, one way to solve this prolem is to remove the line containing server IP address from /root/.ssh/known_hosts . Then connect to it by SSH again, it will ask you whether trust this new host key, like following message

Type yes and press Enter key, this new host key is added to .ssh/known_hosts  then.

 

Also you can obtain the host key from the remote server, and add it to .ssh/known_hosts  manually , but we won’t cover this method in detail.