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

libssh2/mbedtls: can't login to sftp using ONLY private key #4568

Closed
nojb opened this issue Nov 7, 2019 · 5 comments
Closed

libssh2/mbedtls: can't login to sftp using ONLY private key #4568

nojb opened this issue Nov 7, 2019 · 5 comments
Labels

Comments

@nojb
Copy link

nojb commented Nov 7, 2019

I did this

I am trying to login to an sftp server where with private key ONLY.

$ curl -v -s -k --key <path to private key> sftp://<login>:<sftp server>
* Rebuilt URL to: sftp://<login>:<sftp server>
*   Trying 208.22.57.176...
* TCP_NODELAY set
* Connected to <sftp server> (208.22.57.176) port 22 (#0)
* SSH MD5 fingerprint: 6bd3192a0dda65da1c962a3e00e7ee57
* SSH authentication methods available: publickey,password,keyboard-interactive
* Using SSH private key file '<path to private key>'
* SSH public key authentication failed: Username/PublicKey combination invalid
* Failure connecting to agent
* Authentication failure
* Closing connection 0

I expected the following

To be able to log in the server. This used to work with WinCNG and supposedly works with OpenSSL as well (but I have not tested it personally).

curl/libcurl version

curl 7.54.1 (x86_64-pc-win32) libcurl/7.54.1 mbedTLS/2.16.3 zlib/1.2.11 WinIDN libssh2/1.9.0
Release-Date: 2017-06-14
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz

operating system

Windows

@dfandrich
Copy link
Contributor

dfandrich commented Nov 7, 2019 via email

@nojb
Copy link
Author

nojb commented Nov 7, 2019

Does the equivalent OpenSSH sftp command work?

Yes, just tried it.

@bagder bagder added the SCP/SFTP label Nov 7, 2019
@bagder
Copy link
Member

bagder commented Nov 7, 2019

This used to work with WinCNG and supposedly works with OpenSSL as well (but I have not tested it personally).

You're then talking about different libssh2 builds, right? And if so, isn't this then just a problem with libssh2 and not curl?

@nojb
Copy link
Author

nojb commented Nov 7, 2019

You're then talking about different libssh2 builds, right? And if so, isn't this then just a problem with libssh2 and not curl?

Yes, that may be it. Sorry, it was a bit unclear in my mind about the division of responsibilities between the two libraries. Should I close this issue and open a new issue in the libssh2 repository ?

@bagder
Copy link
Member

bagder commented Nov 7, 2019

If the issue is caused by just replacing the libssh2 library, then the problem can with some certainty be said to be within libssh2 and then it is a libssh2 issue that's best filed there.

@nojb nojb closed this as completed Nov 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants