Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticating with Public/Private key #24

Open
jesper-bylund opened this issue Jun 30, 2019 · 3 comments · May be fixed by #28
Open

Authenticating with Public/Private key #24

jesper-bylund opened this issue Jun 30, 2019 · 3 comments · May be fixed by #28

Comments

@jesper-bylund
Copy link
Contributor

jesper-bylund commented Jun 30, 2019

Not really an issue I guess, more an open question:

I'm trying to open a shell with an RSA key, but I can't quite follow the code to see how that's done. Am I right in believing I should be using the authorise() method? The challenge seems to accept public/private keys, but I can't figure out how.

@jesper-bylund
Copy link
Contributor Author

jesper-bylund commented Jun 30, 2019

I'm trying the following:

self.authenticationChallenge = .byPublicKey(username: self.username, password: self.password, publicKey: self.publicKey, privateKey: self.privateKey)

But I get this response:

DEBUG: Timeout set to 10.0 seconds
INFO: Libssh2 v1.8.0
DEBUG: ec2-54-77-251-54.eu-west-1.compute.amazonaws.com resolved. 1 addresses
WARN: Connection to 54.77.251.54 on port 22 failed
INFO: Bye bye
DEBUG: Disconnected

The username and keys are hardcoded and work fine using vanilla NSSH (but I can't get that shell to work). There is however no password, just an empty string. Could that create this issue?
How can I debug the challenge?

@jesper-bylund
Copy link
Contributor Author

Strangely, this code actually does work. But only 1 out of 3 times. No idea why as I'm unsure how to debug.

@bakertim bakertim linked a pull request Sep 18, 2019 that will close this issue
@bakertim
Copy link

I had a similar issue which was caused by a very short timeout creating the connection. See PR #28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants