SFTP使用cURL [英] SFTP using cURL

查看:338
本文介绍了SFTP使用cURL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过sftp协议ftp文件到客户端:

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

输入用户的主机密码 XJ0002T

Curl不断要求我输入密码。我已经尝试过使用OpenSSH和puttyGen的密钥对,都没有工作。有人可以告诉我我做错了什么?

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?

推荐答案

curl要求您输入密码,因为您使用-u并提供用户名但没有密码。

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

提供一个空白密码,而不是-u用户名:(注意冒号),它会停止询问。

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

这篇关于SFTP使用cURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆