Not able to transfer file to SFTP using cURL

1.2k Views Asked by At

I need to transfer a certain file to a SFTP along with private key and passphrase for private key. I am using following cURL command format but I am getting

curl error code 7:couldn't connect to host

Please have a look at below cURL command and suggest what am I doing wrong here.

curl -v -T FileName --key KeyPath --pass KeyPassCode \
> -u ftpusername:ftpPassWord sftp://Sftpdomain.com:port 
1

There are 1 best solutions below

0
On

Your command-line looks good, it connects fine for me.

So I assume your host name or port is wrong or not reachable. Just as the error message says.