Monday 25 January 2016

SecureShell ECDSA host key Error

When using Secure Shell in chromeOS on your chromebook, if you format your SD card your ECDSA key will change preventing you from being able to connect to your pi at the same address as before. To fix this you need to clear the saved keys in your client.


- The error screen will look something like 

Connecting to pi@192.168.1.132, port ??...
Loading NaCl plugin... done.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 ECDSA key sent by the remote host is
a1::a1::a1::a1::a1::a1::...
Please contact your system administrator.
Add correct host key in /.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /.ssh/known_hosts:1
ECDSA host key for 192.168.1.132 has changed and you have requested strict checking.
Host key verification failed.
NaCl plugin exited with status code 255.
(R)econnect, (C)hoose another connection, or E(x)it?


- To fix this make sure you are in SecureShell and press Ctrl + Shift + J 

- If you know the index of the offending host entry (it's usually reported by ssh if the connection fails) you can   open the JavaScript console and type...
     term_.command.removeKnownHostByIndex(index) 
  Replace index with the numeric, one-based host index.

OR

  If you don't know the index, or you'd like to clear all known hosts, type...
     term_.command.removeAllKnownHosts() 

______________________________________________________________
This article uses content from the Google groups page, thanks to Robert Ginda