Chomebook Secure Shell – Remove ssh key from known_hosts

One problem with the Secure Shell plugin is when you need to remove an ssh key from the known_hosts file there is no direct access to the file from the file system. This issue comes up normally when you run into the error message below.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ED25519 key sent by the remote host is
SHA256:C//eoM00fEk4Z8YH6bAp7NdGyhqm24Xsmj/wDl81TEc.
Please contact your system administrator.
Add correct host key in /.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /.ssh/known_hosts:9
Host key for xx.xx.xx.xx has changed and you have requested strict checking.
Host key verification failed.

Which will come up when you re-image an existing host or replace an existing host with another host using the same IP address/host name. The previous way of doing this used to be do (CTRL + SHIFT + J) to bring up the terminal and then run the command “term_.command.removeKnownHostByIndex(INDEX); ” but this doesn’t always work for me as “command” isn’t always available. The most consistent way I have found to resolve this is to bring up Secure Shell and choose Options -> SSH Files you will see your known_hosts file with the ability to modify and save it. Remember to save after your changes and you should be good to go.

Leave a Reply

Your email address will not be published. Required fields are marked *