I am building curl with the following configuration :
./configure --with-ssl --with-libssh2 --prefix=/home/yuvi/development/curlssh
After configuration I can see that SCP is Enabled.
curl version: 7.24.0
Host setup: x86_64-unknown-linux-gnu
Install prefix: /home/yuvi/development/curlssh
Compiler: gcc
SSL support: enabled (OpenSSL)
SSH support: enabled (libSSH2)
zlib support: enabled
krb4 support: no (--with-krb4*)
GSSAPI support: no (--with-gssapi)
SPNEGO support: no (--with-spnego)
TLS-SRP support: no (--enable-tls-srp)
resolver: default (--enable-ares / --enable-threaded-resolver)
ipv6 support: enabled
IDN support: no (--with-libidn)
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
Verbose errors: enabled (--disable-verbose)
SSPI support: no (--enable-sspi)
ca cert bundle: /etc/ssl/certs/ca-certificates.crt
ca cert path: no
LDAP support: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS support: no (--enable-ldaps)
RTSP support: enabled
RTMP support: no (--with-librtmp)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S RTSP SCP SFTP SMTP SMTPS TELNET TFTP
But when I run the sample program I am getting following error :
* Protocol scp not supported or disabled in libcurl
* Unsupported protocol
My url is :
curl_easy_setopt(curl, CURLOPT_URL,"scp://192.168.10.1/mnt/dev.zip");
I am able to retrieve file using command prompt through SCP, it means that remote server supports SCP. Then where I am doing wrong…?
Thanks,
Yuvi
I would try LD_PRELOAD to make sure the program is using the right
libcurl.so. Something like:In case of linking with the static library
libcurl.a, the program contains several symbols withscpas substring:This assumes that curl has been compiled with debugging enabled (-g) and that debugging symbols weren’t stripped from
sample-program. If output ofnm sample-program | grep scpis empty, then:libcurl.awhich was compiled without support for SCP protocol, orlibcurl.so(not the static librarylibcurl.a)