Hello all,

I have am having problems with ssh after a new OS install on a remote server. I am now unable to connect to the remote server via ssh becuase of the following error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!                                     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
e4:00:85:b2:5b (I deleted a section from this value before posting).
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:1
RSA host key for <remote-server-ip> has changed and you have requested strict checking.
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at io.c(453) [receiver=2.6.9]

I checked the "/root/.ssh/known_hosts" and the folder does not exist, I even used "find" to look for the file and it said that it did not exist. I checked the same directory on my local linux box and I see the "known_hosts" file, but it simply does not exist on the remote server. I reinstalled ssh with yast and it still did not work. What do I need to do in order to get ssh working properly, along with having the configuration file in the .ssh folder under the root directory?

Thanks ahead of time for the help!!!

I figured it out...

Yeah, the solution to this is to remove your .ssh/known_hosts file and reconnect.

Yeah, the solution to this is to remove your .ssh/known_hosts file and reconnect.

Not necessarily a good habit to get into. The warning is there for exactly that: to warn you. Someone could be executing a man-in-the-middle attack, so I'd only recommend ignoring the warning if you actually know the reason (such as if you're got a LAN and you're connecting to a computer whose IP address has changed). Otherwise, proceed with extreme caution.

The other thing is that it's probably better to edit the known_hosts file and remove the offending key once you've identified that indeed the remote host key has changed, rather than deleting the file, as you'll lose all the keys to your other hosts that you've connected to in the past. This means that the next time you connect to them, you'll have no way of verifying if you're actually connecting to the same machine.

if the server you are connecting to has an IP assigned by DHCP you will get this error too

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.