0

我需要从使用 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]
4

1 回答 1

0

从 scp 函数的 R 文档中,您的密钥似乎没有密码,因此请尝试keypasswd = NA完全设置或删除该参数。

于 2017-06-15T23:45:11.613 回答