当我使用用户名和密码手动sftp时,它工作正常,而使用curl时,它会失败。相同的脚本将成功连接到其他服务器,而不会出现问题。因为我可以手动登录,并且其他客户端没有问题,所以服务器管理员的帮助不大。
这是卷曲失败的尝试:
curl -v --insecure --user username:password sftp://someurl.com
* Trying 199.187.***.***...
* Connected to someurl.com (199.187.***.***) port 22 (#0)
* SSH MD5 fingerprint: 6831eae63f230952a1775e0f67f80e7b
* SSH authentication methods available: publickey,gssapi-keyex,gssapi with-mic,password
* Using SSH public key file '(nil)'
* Using SSH private key file ''
* SSH public key authentication failed: Unable to extract public key from private key file: Unable to open private key file
* Failure connecting to agent
* Authentication failure
* Closing connection 0
curl: (67) …Run Code Online (Sandbox Code Playgroud)