Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed curl-7.27.0 and it is working fine how ever it is not working is run below command to find whether it is now, but it showed that :

Result of the command curl -V

root@ubuntu:~/curl-7.27.0# curl -V
curl 7.21.6 (i686-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/ 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

share|improve this question

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer
I have gone through that when I googled it, how ever there is a small problem I am facing with in that. what you have menssioned up there is there in this link. <br/> ** 1) how ever I could not find curl-x.xx.x/debian directory or file anywhere even after extracting curl source? <br/> 2) Might be possible that I do not have an idea which is the right source? how ever the source I download is in this Curl Source –  Rishee Oct 3 '12 at 3:32
Still I would like to thank you for at least trying to resolve the issue and request you to please check on the 2 issues that I have mentioned up here. have a gr8 time. –  Rishee Oct 3 '12 at 3:39

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:

sudo aptitude hold libcurl3
sudo aptitude hold libcurl3-gnutls

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.