aaaaaah my ssh got spoofed …… or what!!!

on

Ok I revamped an older atom machine into a backup thingy. Cleared all disks installed ubuntu server 12.04 with all needed whistles and bells.

So I started a test session with some rsync from my main machine to that new server.

knilluz@this-server:~$ sudo rsync -avh /home/knilluz/test knilluz@other-server:/home/knilluz

When I got

 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 The RSA host key for other-server has changed,
 and the key for the corresponding IP address xxx.xxx.xxx.xxx
 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.
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @ 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
 89:xx:4a:xx:d2:xx:e9:xx:93:xx:86:xx:41:xx:c0:xx.
 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 other-server has changed and you have requested strict checking.
 Host key verification failed.
 rsync: connection unexpectedly closed (0 bytes received so far) [sender]
 rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]

No shit. He keep calm. New machine, new hashvalues. Just let’s remove the old values
The line “Offending key in /root/.ssh/known_hosts:1” tells me to remove the first line:

knilluz@this-server:~$ sudo sed -i '1d' /root/.ssh/known_hosts

That’s it. Happy rsyncing now.