SFTP using cURL

I am trying to transfer the ftp file through the sftp protocol to the client:

curl -u username --key C:\cygwin\home\XJ0002T\.ssh\id_rsa --pubkey c:\cygwin\home\XJ0002T\.ssh\id_rsa.pub - T c:\temp2\test4.txt sftp://server/SFTP/ --insecure 

Enter the password for user XJ0002T :

Curl keeps asking me for a password. I tried key pairs using OpenSSH and puttyGen, and did not work. Can someone tell me what I am doing wrong?

+6
source share
1 answer

curl asks you for a password because you use -u and specify a username, but not a password.

Specify an empty password instead of: -u username: (note the trailing colon) and it will stop asking.

+8
source

Source: https://habr.com/ru/post/886021/


All Articles