Re: curl sftp connection problem

toby via curl-users <[email protected]> Mon, 16 Mar 2026 10:41:40 -0600
Newsgroups gmane.comp.web.curl.general
Message-ID <[email protected]>
i finally got tired of messing with host keys/keygen/id_* etc and recompiled my original WORKING curl version 7.78.0 and guess what it works again with no problems to sshd or proftpd



> Hi
> 
> i have latest libssh2, curl, openssh and oroftpd installed from source
> 
> curl -V
> curl 8.18.0 (x86_64-pc-linux-gnu) libcurl/8.18.0 mbedTLS/3.6.5 zlib/1.2.12 libssh2/1.11.1 librtmp/2.3
> Release-Date: 2026-01-07
> Protocols: dict file ftp ftps http https imap imaps ipfs ipns mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps tftp ws wss
> Features: alt-svc AsynchDNS HSTS HTTPS-proxy Largefile libz NTLM SSL threadsafe UnixSockets
> 
> the sftp program from openssh works fine connecting to both proftpd (set up for sftp) and sshd
> /usr/local/bin/sftp -v -oPort=212 [email protected]
> 
> curl to the proftpd also set uo for ftps works fine  (proftpd ftps : 21   and  sfto : 212)
> /usr/local/bin/curl -v -k -u uwer:pass --ssl-reqd ftp://myserver.net/
> 
> i really want to use curl with sftp to connect to either sshd or proftpd instead of using the sftp command
> i get the same error using curl to either sshd or proftpd with this line
> 
> /usr/local/bin/curl -v -k -u user sftp://myserver.net:212
> * libssh2 cryptography backend: openssl compatible
> * User: 'user'
> * Failure establishing ssh session: -8, Unable to exchange encryption keys
> * closing connection #0
> curl: (2) Failure establishing ssh session: -8, Unable to exchange encryption keys
> 
> this is from th proftpd sftp.log file
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]: client (xxx.xxx.xx.xxx:52884) connected to server (xxx.xxx.xx.xxx:212)
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]: sent server version 'SSH-2.0-mod_sftp'
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]: received client version 'SSH-2.0-libssh2_1.11.1'
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]: handling connection from SSH2 client 'libssh2_1.11.1'
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]:  + Session key exchange: ecdh-sha2-nistp256
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]:  + Session host key algorithm: rsa-sha2-512
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]:  + Session server hostkey: rsa-sha2-512
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]:  + Session client-to-server encryption: [email protected]
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]:  + Session server-to-client encryption: [email protected]
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]:  + Session client-to-server compression: none
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]:  + Session server-to-client compression: none
> 2026-03-10 16:54:44,027 mod_sftp/1.2.0[7982]: client at xxx.xxx.xx.xxx sent SSH_DISCONNECT message: Shutdown (Application disconnected)
> 
> i had a curl encryption problem a long time ago and had to add some new cipher line to a ssh/sshd config file but openssh isn't involved here
> just proftpd
> 
> amy place to start would be appreciated
> 
> -- 
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
> Etiquette:   https://curl.se/mail/etiquette.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html