This repository was archived by the owner on Jul 25, 2020. It is now read-only.
JCLOUDS-921 prioritise key over password in SSHClientConnection#761
Closed
stuarthendren wants to merge 1 commit intojclouds:masterfrom
stuarthendren:jclouds-921
Closed
JCLOUDS-921 prioritise key over password in SSHClientConnection#761stuarthendren wants to merge 1 commit intojclouds:masterfrom stuarthendren:jclouds-921
stuarthendren wants to merge 1 commit intojclouds:masterfrom
stuarthendren:jclouds-921
Conversation
From ticket: If keyboard interactive login is not allowed on the box but the user also requires a sudo password the ssh fails as it prioritises the password. If you remove the password then the sudo fails in the SudoAwareInitManager. It would seem better to prioritise the key over the password in SSHClientConnection or possibly try both if they are both present, and the first fails. This commit swaps the order of the if else check to use the ssh key if present.
Contributor
|
The approach looks good to me. Thanks @stuarthendren! |
Contributor
|
Pushed to master and 1.9.x. I've also added a commit after yours to align the Jsch driver, which was required after merging #735. Thanks @stuarthendren! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
From ticket:
If keyboard interactive login is not allowed on the box but the user also requires a sudo password the ssh fails as it prioritises the password.
If you remove the password then the sudo fails in the SudoAwareInitManager.
It would seem better to prioritise the key over the password in SSHClientConnection or possibly try both if they are both present, and the first fails.
This commit swaps the order of the if else check to use the ssh key if present.