ukanonymous
Posts: 71
Joined: Sat May 25, 2013 10:17 am

Argh!

Tue Jul 02, 2013 8:27 pm

How do I fix this please? I reloaded the SD card with weezy and then tried to SSH and got this
pc5:~ raspberrypi$ ssh pi@192.168.1.17
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
51:78:12:a7:cc:79:11:52:c3:e2:f8:18:da:42:72:b2.
Please contact your system administrator.
Add correct host key in /Users/raspberrypi/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/raspberrypi/.ssh/known_hosts:2
RSA host key for 192.168.1.17 has changed and you have requested strict checking.
Host key verification failed.
pc5:~ raspberrypi$

User avatar
rpdom
Posts: 15450
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Argh!

Tue Jul 02, 2013 8:38 pm

You need to delete the old entry from the .ssh/known_hosts file.

"Offending RSA key in /Users/raspberrypi/.ssh/known_hosts:2"

This is telling you that the old key is on line 2 of the file.

There are many ways to do that, but a quick one is with

Code: Select all

sed -i "2d" /Users/raspberrypi/.ssh/known_hosts
(-i is "edit file and save contents back to same file". "2d" means "line 2, delete")

Then try the ssh again. You will probably get a warning at first, but it should still work.

ukanonymous
Posts: 71
Joined: Sat May 25, 2013 10:17 am

Re: Argh!

Tue Jul 02, 2013 8:39 pm

How do I do this though? I only have my laptop to work with :(

ukanonymous
Posts: 71
Joined: Sat May 25, 2013 10:17 am

Re: Argh!

Tue Jul 02, 2013 8:40 pm

I got this
pc5:~ raspberrypi$ sed -i "2d" /Users/raspberrypi/.ssh/known_hosts
sed: -i may not be used with stdin
pc5:~ raspberrypi$

surfatwork
Posts: 62
Joined: Mon May 06, 2013 8:26 am

Re: Argh!

Tue Jul 02, 2013 9:08 pm

Use any text editor of choice (vi, nano, gedit, notepad) on your laptop, open /Users/raspberrypi/.ssh/known_hosts, delete line 2, save it and then try the ssh again. You will get a warning, but it will work.

User avatar
rpdom
Posts: 15450
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Argh!

Wed Jul 03, 2013 5:56 am

ukanonymous wrote:I got this
pc5:~ raspberrypi$ sed -i "2d" /Users/raspberrypi/.ssh/known_hosts
sed: -i may not be used with stdin
pc5:~ raspberrypi$
Are you using a Mac? It seems the -i option isn't as flexible under OSX. It won't work if the filename doesn't have a ".something" extension on the end.

As surfatwork said, you can also use any text editor to delete that line.

ukanonymous
Posts: 71
Joined: Sat May 25, 2013 10:17 am

Re: Argh!

Wed Jul 03, 2013 6:40 am

thank you I did it wohoo and now virtually connected. This is awesome

Return to “General discussion”