I have installed curl-7.27.0 and it is working fine. However, when I run curl -V
, I get:
curl 7.21.6 (i686-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/1.2.3.4 libidn/1.22 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp smtp smtps telnet tftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
How do I enable SFTP protocol?
You have to compile
curl
with sftp support first.Download and unpack the curl source. After that:
find and replace "--without-libssh2" with "--with-libssh2"
Update the commands with the adequate versions, ofcourse. More info here.
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.2Customized answer from Frantique:
Download and unpack the curl source. After that:
Find
--without-ssl
and append--with-libssh2
, in my case, it looks like this:Before
After
Now build the packages:
Here is another good tutorial for your issue.
More info on Frantique's answer.
Frantique's answer worked for me - however when I tried to upgrade my system, my package manager wanted to revert the installation back to a curl that does not have sftp/scp.
To avoid having to reinstall curl with sftp/scp after every upgrade:
Use apt-mark if you use apt.
Read this page if you want more info on preventing updates of a specific package.
Note that eventually some future upgrade may not be able to go forward until you remove the hold.
If by chance you are using PHP and need sftp in curl - you should check out phpseclib which might be much easier to install and maintain.
Here is how to build curl with libssl support for Ubuntu 18.04. LTS:
Download the Patch and patch the
debian/rules
:Or alternativ replace in the file the
debian/rules
:with
Then build and install the packages:
Hope that helps somebody.