curl 错误Failure connecting to agent

在使用C语言编程调用curl库执行SFTP功能时遇到错误,具体表现为无法从文件中提取SSH私钥,导致连接到服务器的公共和私人密钥认证失败。尽管如此,curl应该在私钥认证失败后尝试使用用户名和密码进行认证,但仍然报告了授权失败。同样的问题出现在另一个URL上,再次验证了私钥问题。
摘要由CSDN通过智能技术生成

记录一个curl 错误:Failure connecting to agent

报错如下,采用C语言编程调用curl库事项sftp相关功能函数,在实测时的反馈:

*   Trying 192.168.***.***...
* Connected to someurl.com (192.168.***.***) port 22 (#0)
* SSH MD5 fingerprint: 6831eae63f230952a1775e0f67f80e7b
* SSH authentication methods available: publickey,password
* Using SSH private key file '/home/user/.ssh/id_rsa'
* 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的stp协议的流程私钥不通过,会使用用户名及密码尝试获取授权,请检查用户名及密码是否正确,用户名及密码错误不会报告与之相关的错误,只会显示授权失败。
*   Trying 192.168.***.***...
* Connected to anotherurl.com (192.168.***.***) port 22 (#0)
* SSH MD5 fingerprint: bcf5632dc06c0353849b745822c4889a
* SSH authentication methods available: password,publickey
* Using SSH private key file '/home/user/.ssh/id_rsa'
* SSH public key authentication failed: Unable to extract public key from private key file: Unable to open private key file
* Initialized password authentication
* Authentication complete
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值