Skip to content
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#761
stuarthendren wants to merge 1 commit intojclouds:masterfrom
stuarthendren:jclouds-921

Conversation

@stuarthendren
Copy link
Copy Markdown
Contributor

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.

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.
@nacx
Copy link
Copy Markdown
Contributor

nacx commented Jun 2, 2015

The approach looks good to me. Thanks @stuarthendren!
Looking at how the jsch driver manages the credentials I'd say it will already work. Anyway, could you try using it, just to make sure all the ssh drivers are fixed in this issue?

@nacx
Copy link
Copy Markdown
Contributor

nacx commented Jun 11, 2015

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!

@nacx nacx closed this Jun 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants