cURL sftp not supported or disabled in libcurl [duplicate]

Solution 1:

You have to compile curl with sftp support first.

Download and unpack the curl source. After that:

sudo apt-get install build-essential debhelper libssh2-1-dev
sudo apt-get source libcurl3
sudo apt-get build-dep libcurl3

cd curl-x.xx.x/debian

nano rules

find and replace "--without-libssh2" with "--with-libssh2"

cd ..

sudo dpkg-buildpackage

cd ..

sudo dpkg -i curl_xxxxx.deb
sudo dpkg -i libcurl3_xxxx.deb
sudo dpkg -i libcurl3-gnutls_xxxx.deb

Update the commands with the adequate versions, ofcourse. More info here.

Solution 2:

If you can't find --without-libssh2 to replace with --with-libssh2 you can search for --without-ssl and append --with-libssh2, tested with curl Version 7.35.0 on Ubuntu 14.04.2

Customized answer from Frantique:

Download and unpack the curl source. After that:

sudo apt-get install build-essential debhelper libssh2-1-dev
sudo apt-get source libcurl3
sudo apt-get build-dep libcurl3

cd curl-*/debian

nano rules

Find --without-ssl and append --with-libssh2, in my case, it looks like this:

Before

cd debian/build && dh_auto_configure ${CONFIGURE_ARGS}          \
        --with-ca-path=/etc/ssl/certs
cd debian/build-gnutls &&  dh_auto_configure ${CONFIGURE_ARGS}  \
        --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt     \
        --without-ssl --with-gnutls
cd debian/build-nss && dh_auto_configure ${CONFIGURE_ARGS}      \
        --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt     \
        --without-ssl --with-nss

After

cd debian/build && dh_auto_configure ${CONFIGURE_ARGS}          \
        --with-ca-path=/etc/ssl/certs --with-libssh2
cd debian/build-gnutls &&  dh_auto_configure ${CONFIGURE_ARGS}  \
        --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt     \
        --without-ssl --with-gnutls --with-libssh2
cd debian/build-nss && dh_auto_configure ${CONFIGURE_ARGS}      \
        --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt     \
        --without-ssl --with-nss --with-libssh2

Now build the packages:

cd ..
sudo dpkg-buildpackage
cd ..

sudo dpkg -i curl_*.deb
sudo dpkg -i libcurl3_*.deb
sudo dpkg -i libcurl3-gnutls_*.deb

Here is another good tutorial for your issue.

More info on Frantique's answer.