Frank Hoffsümmer | 17 Jul 2012 21:19
Picon
Gravatar

curl + sftp: Failure establishing ssh session

Hello
I am on a Mac, with OS X Lion (10.7.4). I installed curl 7.26.0 via macports as such:

$ sudo port install curl +ssl +sftp_scp

This gives me the following curl version that should support sFTP:

$ /opt/local/bin/curl --version
curl 7.26.0 (x86_64-apple-darwin11.4.0) libcurl/7.26.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.25 libssh2/1.2.7
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

However, when trying to connect to 'myserver' via sftp, I get the following error:

$ /opt/local/bin/curl --verbose --list-only --key ./mykey --pubkey ./mykey.pub sftp://myuser <at> myserver/
* About to connect() to myserver port 22 (#0)
*   Trying XX.XX.XX.XX...
* connected
* Connected to myserver (XX.XX.XX.XX) port 22 (#0)
* Failure establishing ssh session
* Closing connection #0
curl: (2) Failure establishing ssh session

This confuses me to now end, because I can connect to the same 'myserver' using the same 'mykey' via ssh: 

$ /usr/bin/ssh -2 -i ./mykey myuser <at> myserver
Warning: Permanently added the DSA host key for IP address 'XX.XX.XX.XX' to the list of known hosts.
[/]$ 

...and also via sftp:
(Continue reading)

Dan Fandrich | 21 Jul 2012 10:42
Favicon

Re: curl + sftp: Failure establishing ssh session

On Tue, Jul 17, 2012 at 09:19:09PM +0200, Frank Hoffsümmer wrote:
> This gives me the following curl version that should support sFTP:
> 
> $ /opt/local/bin/curl --version
> curl 7.26.0 (x86_64-apple-darwin11.4.0) libcurl/7.26.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.25 libssh2/1.2.7
> Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
> Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 
> 
> However, when trying to connect to 'myserver' via sftp, I get the following error:
> 
> $ /opt/local/bin/curl --verbose --list-only --key ./mykey --pubkey ./mykey.pub sftp://myuser <at> myserver/
> * About to connect() to myserver port 22 (#0)
> *   Trying XX.XX.XX.XX...
> * connected
> * Connected to myserver (XX.XX.XX.XX) port 22 (#0)
> * Failure establishing ssh session
> * Closing connection #0
> curl: (2) Failure establishing ssh session

Are you able to use curl to do the transfer using password
authentication instead of a key?  What crypto back-end is libssh2
configured to use?

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

(Continue reading)


Gmane