1

I followed this guide to create a static IP for my Raspberry Pi running Raspbian Jessie. The static IP is running but my router still lists the old IP address for the Raspberry Pi. I also am no longer able to ssh into my Pi; when I try to ssh using the hostname, the ssh connection times out. On the other hand, when I try to ssh to the static IP, I receive 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 a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
<finger print>.
Please contact your system administrator.
Add correct host key in <path to known_hosts file> to get rid of this message.
Offending RSA key in <path to known_hosts file>:21
RSA host key for <raspberry pi static ip> has changed and you have 
requested strict checking.

How do I fix this?

Steve Robillard
  • 34,988
  • 18
  • 106
  • 110
Jay Karimi
  • 111
  • 2

2 Answers2

1

NEVER delete a known_hosts file, because it will wipe out all the seen keys! And a MitM attack against you will be much easier. Open it with text editor and replace/delete *a single string starting with a hostname. After a hostname there's a key, so either update the key or delete just one string and connect to a new key+address pair

Alexey Vesnin
  • 926
  • 10
  • 17
-1

You get the warning because you changed the IP address. This is security issue as it could mean you are the subject of a man in the middle attack. To fix the problem you can edit the old entry from the known_hosts file. The file is located in the /home/pi/.ssh directory. You can open it in the editor of your choice and delete its contents.

As for your router seeing the old address that will eventual be removed automatically.

Steve Robillard
  • 34,988
  • 18
  • 106
  • 110