This repository was archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 301
ssh: golang/crypto/ssh prioritizes server's kex algo instead of parsing known_hosts first #1526
Comments
OpenSSH logic:
fleetctl+golang/crypto/ssh logic:
|
Here is an example on how to parse known_hosts files https://github.com/golang/crypto/blob/master/ssh/keys_test.go#L391 |
tixxdz
pushed a commit
to endocode/fleet
that referenced
this issue
Apr 1, 2016
Retrieve remote host Key Algorithms from known_host if they are there and use them to perform ssh handshake. Otherwise fallback to default values suggested by remote. This patch is based from a previous patch written by: kayrus <kay.diam@gmail.com> Resolves coreos#1526 and coreos/bugs#1186
tixxdz
pushed a commit
to endocode/fleet
that referenced
this issue
Apr 1, 2016
Retrieve remote host Key Algorithms from known_host if they are there and use them to perform ssh handshake. Otherwise fallback to default values suggested by remote. This patch is based from a previous patch written by: kayrus <kay.diam@gmail.com> Resolves coreos#1526 and coreos/bugs#1186
mischief
pushed a commit
to mischief/fleet
that referenced
this issue
Apr 5, 2016
Retrieve remote host Key Algorithms from known_host if they are there and use them to perform ssh handshake. Otherwise fallback to default values suggested by remote. This patch is based from a previous patch written by: kayrus <kay.diam@gmail.com> Resolves coreos#1526 and coreos/bugs#1186
hectorj2f
pushed a commit
to giantswarm/fleet
that referenced
this issue
Apr 6, 2016
Retrieve remote host Key Algorithms from known_host if they are there and use them to perform ssh handshake. Otherwise fallback to default values suggested by remote. This patch is based from a previous patch written by: kayrus <kay.diam@gmail.com> Resolves coreos#1526 and coreos/bugs#1186
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Original issue was reported here: coreos/bugs#1186
The problem is that golang ssh implementation compares client's
ServerHostKeyAlgos
and server'sServerHostKeyAlgos
and chooses first match depending on the order insupportedHostKeyAlgos
variable:If remote host had
KeyAlgoRSA
key before and it was written into client's.fleetctl/known_hosts
, then SSH on the remote host was upgraded (i.e.ecdsa-sha2-nistp256
support was added), thencrypto/ssh
automatically chooses first match:KeyAlgoECDSA256
and doesn't take into consideration already existing fingerprints. This causesFailed building SSH client: ssh: handshake failed: host key mismatch
error message on the fleetctl client's side.The text was updated successfully, but these errors were encountered: