ssh 之 RSA key change ssh-keygen -R hostname

In the case of a migration, you can be reasonably sure that the RSA key change is not an accident, but to connect to the new server you must remove the line in .ssh/known_hosts that corresponds to your domain name. This can be done by editing ‘known_hosts’ by hand or if your machine has Perl installed you can use this one liner:
perl -p -i -e ‘s/^*n//;’ ~/.ssh/known_hosts Substitute your actual domain for making sure to include a backslash before the dot. If you have several domains that have moved you must repeat this step for each one.
You may also be able to remove the exact known host with the following command via ssh on your local machine. Remember to replace with your own domain.
Offending RSA key in /home/evan/.ssh/known_hosts:296 RSA host key for has changed and you have requested strict checking. Host key verification failed.
ssh-keygen -R hostname
Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).
ssh-keygen -R