Blink: No discoverable way to fix known_hosts key changes

Created on 9 Oct 2019  路  10Comments  路  Source: blinksh/blink

~
blink> ssh 10.0.0.132
Host key for server changed.
RSA key fingerprint is SHA256:U3v+56Bdk/vi3c/IdAuhYayyc/a6fgIR1PquInT7YH4.
For security reason, connection will be stopped
blink>
~

Yeah I know, I reinstalled linux on that raspberry pi, now what do I do? Ideally there'd be some kind of discoverable UI to deal with this, but if I could figure out how to change it on the command line that'd be fine. There's no interactive editor for text files.

I tried some funny stuff like this:

~
awk '!/10.0.0.132/ { print }' known_hosts > known_hosts2
~

But that crashes the app.

Most helpful comment

@ogermer work in progress

All 10 comments

Yep, that crash fixed in v13.

You can use inline sed:

cd ~/.ssh
cat -n known_hosts
# remember line
sed -i.bak '5d' known_hosts
# where 5 is number of line you want to delete

Hey @yury - would be nice to have a basic editor on board (besides ed...)

@ogermer work in progress

It would be great if removing a host from the GUI list cleaned out their keys.

@rcarmo we are working on full featured editor. Would be enough for you?

It would beat the sed hack :)

Definitely can't wait to see said editor. At least we have sed for now!

It would also be a nice fix, if the embeded ssh-keygen would support the option-R <hostnamen>.

In v13.5.8.245 the following works to remove a cached host signature from known_hosts

ssh-keygen -f .ssh/known_hosts -R 192.168.1.23

However, in the spirit of this issue, and my trying to find a working incantation (and then remembering it) for ssh-keygen,
I think it would be handy in config -> Settings -> Hosts if there were a way to clear matching any host keys in the GUI for a given host

Neat ssh-keygen trick. You don't even need to specify the known hosts file explicitely

Was this page helpful?
0 / 5 - 0 ratings