Curl with sftp fails to connect sftp server?
Issue
- Curl with sftp fails to connect sftp server (especially third party sftp servers), however normal sftp works just fine.
[test@example.com]$ /usr/bin/curl -v -u testing:testing@123 sftp://sftp.example.com
Enter host password for user 'testing':
* About to connect() to sftp.example.com port 22 (#0)
* Trying XX.XX.XX.XX
* Connected to sftp.example.com (XX.XX.XX.XX) port 22 (#0)
* Failure establishing ssh session
* Closing connection 0
curl: (2) Failure establishing ssh session
[test@example.com]$
Environment
- Red Hat Enterprise Linux 7
- Curl-7.29.0-51.el7.x86_64 and before.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.