【问题标题】:RCurl SSH public key authentication failed: Callback returned errorRCurl SSH公钥认证失败:回调返回错误
【发布时间】:2016-12-27 23:04:27
【问题描述】:

我需要从使用 ssh 密钥进行身份验证的 Linux 服务器获取配置文件。我被“回调返回错误”消息卡住了。

conf = scp(host="10.10.10.10", path="/home/admin/codebase/config.txt", 
        user="admin", keypasswd = "", verbose=TRUE,
        key=c("C:/echinn/.ssh/my_public_key", "C:/echinn/.ssh/my_private_key"))

我得到以下输出

*   Trying 10.10.10.10...
* Connected to 10.10.10.10 (10.10.10.10) port 22 (#0)
* SSH MD5 fingerprint: 8fa4562037d2f1e68c7ff419f9dc7656
* SSH authentication methods available: publickey,gssapi-keyex,gssapi-with-mic
* Using SSH public key file 'C:/echinn/.ssh/my_public_key'
* Using SSH private key file 'C:/echinn/.ssh/my_private_key'
* SSH public key authentication failed: Callback returned error
* Failure connecting to agent
* Authentication failure
* Closing connection 0
Error in function (type, msg, asError = TRUE)  : Authentication failure

我也尝试过使用“getURL()”,但最终出现了同样的错误。我能够使用具有相同公钥/私钥(.ppk 格式)的 putty 和 WinSCP 成功连接。

在 Linux 服务器 /var/log/secure 上,每次执行都会看到以下内容

sshd[xxxx]: Connection closed by x.x.x.x [preauth]

【问题讨论】:

    标签: r ssh scp rcurl geturl


    【解决方案1】:

    From the R Documentation for the scp function,您的密钥似乎没有密码,因此请尝试设置 keypasswd = NA 或完全删除该参数。

    【讨论】:

      猜你喜欢
      • 2013-01-23
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-20
      相关资源
      最近更新 更多