Curl command line does not support SFTP

Issue #27 resolved
Former user created an issue

Hello,

According to the official website https://curl.haxx.se/ the curl command line tool supports SFTP.

Nevertheless the curl command tool for IBMi, available on the IBMi opensource repository: ftp://public.dhe.ibm.com/software/ibmi/products/pase/rpms/repo, does not support SFTP.

When I try to use sftp with curl I have the following issue:

curl -v -l sftp://system_fqdn -P system_port -u user:password --socks5  
proxy_fqdn -U 'proxy_user:                                              
proxy_pwd'                                                              

* Rebuilt URL to: sftp:                                                 
//system_fqdn/                                                          

* Protocol "sftp" not supported or disabled in                          
libcurl                                                                 
* Closing connection                                                    
-1                                                                      

curl: (1) Protocol "sftp" not supported or disabled in                  
libcurl                                                                 
$

If I check the protocol supported by the IBMi version of the curl command, SFTP is not supported:

> pwd                                                                                                                              
   /Qopensys/pkgs/bin                                                                                                               
   $                                                                                                                                
 > curl --version                                                                                                                   
   curl 7.58.0 (powerpc-ibm-os400) libcurl/7.58.0 OpenSSL/1.0.2o zlib/1.2.11                                                        
   Release-Date: 2018-01-24                                                                                                         
   Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp                       
   Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy                                         
   $                         

Is it possible to add the SFTP support to curl ?

Thank you.

Comments (9)

  1. Kevin Adler

    It should be possible, yes.

    However, to enable SFTP support in curl requires building and linking to libssh2. Since we currently don't ship libssh2, we will have to port and build it and get it through legal approvals before we could even begin to get curl using it. I wouldn't expect this to work anytime soon.

  2. Jesse G

    Hello,

    According to the official website https://curl.haxx.se/ the curl command line tool supports SFTP.

    Nevertheless the curl command tool for IBMi, available on the IBMi opensource repository: ftp://public.dhe.ibm.com/software/ibmi/products/pase/rpms/repo, does not support SFTP.

    When I try to use sftp with curl I have the following issue:

    curl -v -l sftp://system_fqdn -P system_port -u user:password --socks5  
    proxy_fqdn -U 'proxy_user:                                              
    proxy_pwd'                                                              
    
    * Rebuilt URL to: sftp:                                                 
    //system_fqdn/                                                          
    
    * Protocol "sftp" not supported or disabled in                          
    libcurl                                                                 
    * Closing connection                                                    
    -1                                                                      
    
    curl: (1) Protocol "sftp" not supported or disabled in                  
    libcurl                                                                 
    $
    

    If I check the protocol supported by the IBMi version of the curl command, SFTP is not supported:

    > pwd                                                                                                                              
       /Qopensys/pkgs/bin                                                                                                               
       $                                                                                                                                
     > curl --version                                                                                                                   
       curl 7.58.0 (powerpc-ibm-os400) libcurl/7.58.0 OpenSSL/1.0.2o zlib/1.2.11                                                        
       Release-Date: 2018-01-24                                                                                                         
       Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp                       
       Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy                                         
       $                         
    

    Is it possible to add the SFTP support to curl ?

    Thank you.

  3. Jesse G

    Greetings. Just updating to let you know this issue isn’t completely dormant. We are looking into adding this support.

  4. Musse

    @nodsater

    Update:

    We have successfully built curl with sftp support using libssh2. We are now awaiting approval before shipping the rpm.

  5. Log in to comment