print friendly version

Questions and answers

How can I connect to a secure shell session if I get a notification that its identification has changed?

When you connect to a remote UNIX or Linux service using secure shell (ssh), you might receive a warning like this one if the service has moved to a different server:

The RSA host key for has changed,
and the key for the corresponding IP address
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.

Because the location of the service has changed since the last time you connected, your computer warns you to check before you continue as it could mean that someone is trying to redirect you to a fraudulent service. However, this also happens if the service is relocated, as when the server was moved to a different machine in March 2018.

To continue with the connection on a Mac or Linux computer, you have to first remove the existing fingerprint of the server from your known_hosts file. You can do this for using the following command:

ssh-keygen -R

or this command to remove all keys for a server with a name starting with "unix":

sed '/^unix/ d' ~/.ssh/known_hosts

Help us to improve this answer

Please suggest an improvement
(login needed, link opens in new window)

Your views are welcome and will help other readers of this page.


This is question number 2761, which appears in the following categories:

Created by David Guest on 12 November 2015 and last updated by Alexander Butler on 12 March 2018