cURL / Mailing Lists / curl-library / Single Mail


Re: How to do sftp without an SSH agent

From: <>
Date: Tue, 16 Apr 2013 13:05:14 -0700

At 01:57 PM 4/11/2013, you wrote:
>You don't need to use the option CURLSSH_AUTH_AGENT if you don't
>want to use it. It's just there to make it easier for users with a
>pre-generated DSA/RSA key pair to log into an SSH server. If you set
>it to CURLSSH_AUTH_ANY, then libcurl will pick one, and your app may
>need to ask users for their passphrase if they want to authenticate
>using a key pair rather than a password.

I have set CURLSSH_AUTH_ANY, but now how do I get the password SSH
apparently requires? Here is what I am seeing in the libssh2 debug
log (URL and username changed):

* About to connect() to 111.222.333.44 port 22 (#0)
* Trying 111.222.333.44...
* Connected to 111.222.333.44 ( port 22 (#0)
* User: username
* Password:
* SSH socket: 5808
[libssh2] 0.750000 Conn: Setting blocking mode OFF
[libssh2] 20.578125 Transport: session_startup for socket 5808
[libssh2] 127.437500 Transport: Sending Banner: SSH-2.0-libssh2_1.4.3
[libssh2] 130.828125 Socket: Sent 23/23 bytes at 00A6043C+0
[libssh2] 131.515625 Socket: Error recving 1 bytes: 5 (this is "Access denied")
[libssh2] 132.156250 Failure Event: -43 - Failed getting banner
* Failure establishing ssh session
[libssh2] 132.796875 Transport: Freeing session resource
[libssh2] 134.843750 Transport: Extra packets left 0
* Closing connection 0
curl told us 2

I am guessing the session failed because I didn't give the password.
In the Curl example started with, there was also no explicit password
sent. I assumed this was taken care of by pageant. However, I am not
familiar with SSH.

List admin:
Received on 2013-04-16