Repository navigation
Conversation
|
looks like I re-discovered #794 (I had forgotten the details of that), I'll remove that change from this PR if/when that (linked diff) gets in |
814ba00 to
718088c
Compare
_verify_key() only supported ecdsa-sha2-nistp256, ssh-rsa, ssh-dsa
If we have server host keys that will be checked, need need to negotiate for one of the types we have. Commonly, openssh could have saved an ecdsa key but SSHClient will let the Transport negotiate for an rsa key. Then it would consider a key of a non-corresponding type to be "missing". That situation is also now a BadHostKeyException.
openssh client seems to prefer ecdsa server host keys
82a6432 to
b53915d
Compare
3 similar comments
|
Made some updates:
Regarding Tested with known_hosts containing just:
with the server configured with:
And succeeds / fails where I expect 😁 I think this approach is more correct than #900. In this approach, the client prefers the key type(s) that it has in known_hosts. This enhances Fabric behavior with no changes to Fabric. This is also what the openssh client seems to do. Also, by coincidence, this is also what putty now does as of the 0.68 release yesterday (since it only now supports ecdsa keys):
In #900, the user of the SSHClient must specify the correct key type. That would require changes to Fabric to be useful with it. Further, note that currently, and in #900, if a different key type is negotiated from the server than is present in With this PR, if the server is not configured with a key type that is in |
|
This issue is hitting me quite hard. I'd really appreciate it if this could be merged and a new release created ASAP. |
|
If any parts of this could be considered "fixes" for existing functionality, I would be willing to open a branch with the desired parts backported to the desired older version, then rebase this on top of master after that whole process goes through. Or just having all this in the 2.2 release is also fine with me :) |
|
I'm going to open two new pull requests, as an alternative to this one. You should see the references to them show up below this comment later today :)
|
|
alternative PRs opened ^^ |
|
Closing in favor of the newer PRs, thanks! |
fixes #865
Note that
Transport.connect()already does something similar: if a hostkey is passed, it sets_preferred_keysto the type of that hostkey. (But SSHClient does not use Transport.connect(), it uses the alternativestart_client()for more control.)See commit messages for more details. Also, I'll be doing a bit more testing with different sets of key types available on the server, just to be sure...