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

how do I enable publickey auth in my SFTP client code? #233

Closed
bagder opened this issue Jan 15, 2020 · 3 comments
Closed

how do I enable publickey auth in my SFTP client code? #233

bagder opened this issue Jan 15, 2020 · 3 comments
Assignees
Labels

Comments

@bagder
Copy link

bagder commented Jan 15, 2020

Hi again!

We've now merged initial support for wolfSSH in curl. It however struck me I haven't fixed publickey auth in the curl use of wolfssh (curl/curl#4820), and I find the docs rather lacking in this aspect.

What do I need to do to enable publickey auth? In my test case the server accepts publickey auth but my callback set with wolfSSH_SetUserAuth() gets called numerous times but only with authtype == WOLFSSH_USERAUTH_PASSWORD:

https://github.com/curl/curl/blob/68403cdbc6325bcbe4e4128c263db5d04a3c77c6/lib/vssh/wolfssh.c#L393-L395

(A secondary issue is that wolfssh git master doesn't build for me after I updated this afternoon (thinking maybe I needed an update), which is surprising since your CI builds all look green but I'll save that for now.)

@JacobBarthelmeh
Copy link
Contributor

Hey Daniel,

That's great with the initial support merged in!

Thanks for the report, I see the curl test number in the link. I did a quick sanity check on the password based example bundled in wolfSSH and it went okay, so looks like I will need to dig into it a bit more to find the difference.

cd wolfssh
./examples/server/server
ssh -i ./keys/hansel-key-rsa.pem -p 22222 hansel@127.0.0.1

Regards,
Jacob

@JacobBarthelmeh
Copy link
Contributor

I opened a PR with changes I did for resolving linking while investigating this.

@JacobBarthelmeh
Copy link
Contributor

After more investigation this looks like something we need to change in wolfSSH. Dealing with how the flag for public key connections on the client side get handled. You can change this location of code (https://github.com/wolfSSL/wolfssh/blob/master/src/internal.c#L3813) for testing but we will work on a better runtime way for setting public key on the client side

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

No branches or pull requests

2 participants