SFTP using cURL

2019-04-26 14:16发布

I am trying to ftp a file via sftp protocol to a 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 host password for user XJ0002T:

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

1条回答
Viruses.
2楼-- · 2019-04-26 14:33

Explicitly provide blank password

curl asks you for a password because you use -u and provide a username but no password.

Provide a blank password instead with -u username: (notice the trailing colon) and it will stop asking.

查看更多
登录 后发表回答