Repository navigation
Fix compatibility with paramiko >= 2.9.0 and older OpenSSH server versions - #1685
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #1685 +/- ##
==========================================
- Coverage 83.26% 83.25% -0.00%
==========================================
Files 400 400
Lines 87321 87332 +11
Branches 9284 9285 +1
==========================================
+ Hits 72701 72706 +5
- Misses 11460 11466 +6
Partials 3160 3160
🚀 New features to boost your workflow:
|
servers which don't support SHA2 based pubkey algorithms.
Kami
force-pushed
the
paramiko_2_9_compatibility
branch
from
May 11, 2022 18:51
50af355 to
29b0401
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates paramiko SSH connection related code so it works with paramiko >= 2.9.0 and older OpenSSH server versions which don't support SHA-2 variants of the RSA key verification algorithm.
Background, Context
Paramiko v2.9.0 introduced a change which adds support and prefers SHA-2 variants of the RSA key verification algorithm (https://github.com/paramiko/paramiko/blob/2.9.0/sites/www/changelog.rst#changelog).
This change is backward incompatible and won't work it user tries to use paramiko >= 2.9.0 with older OpenSSH servers such as the default setup on Ubuntu 14.04.
Proposed Soluton
In this PR I introduced a change to fall back to the previous / old approach in case "authentication error" is throw when connecting to the server when running paramiko >= 2.9.0. Sadly there is no easy way to catch and retry only on more granular / specific exception.
This way the code works and supports older and newer versions of paramiko and OpenSSH servers.
Note on Security
For security reasons, if user knows they will only connect to new OpenSSH versions which support those variants +
MSG_EXT_INFOextension, they are encouraged to disable this compatibility change by settingLIBCLOUD_PARAMIKO_SHA2_BACKWARD_COMPATIBILITYenvironment variable tofalse.