dropbear icon indicating copy to clipboard operation
dropbear copied to clipboard

dbclient: fix -y and save hostkey to known_hosts

Open stokito opened this issue 2 years ago • 1 comments

The -y should behave as -oStrictHostKeyChecking=accept-new. So we don't just accept new keys but store them to recheck if they weren't changed.

Without this the -y is same as -y -y if the know_hosts is empty.

The bug fix may be breaking if some script by mistake expected that the -y is just to disable the checking at all.

stokito avatar Dec 29 '23 06:12 stokito

to make it more clear I just removed if (!cli_opts.always_accept_key). That's it.

stokito avatar Dec 29 '23 06:12 stokito

The problem is with virtual hostname which can be used to connect to a cluster and end up on any node. So the user@virtualhostnm can have multiple different hostkeys... If you add it to the known hosts and the next time the connection ends up on another node you get a different hostkey..

For this reason we use the -y -y option.

HansH111 avatar Jan 30 '24 18:01 HansH111

I think this is already covered in extra changes I added to #269 . Let me know if there is something missing.

mkj avatar Apr 03 '24 13:04 mkj

Checked, fixed. Thank you

stokito avatar Apr 07 '24 18:04 stokito