我正在尝试编写一个通过SSH运行远程shell命令的R脚本(在Windows机器上),然后使用scp对文件进行操作并对其进行操作.
ssh.utils不会在Windows上运行,RCurl不断抛出"身份验证失败":
#Failed attempt:
file <- scp(host = "1.2.3.4", path = "/path-to-file", key = "~/../Desktop/id_rsa.pub", user = "admin", keypasswd = "")
Run Code Online (Sandbox Code Playgroud)
消息,即使我将它引用到正确的公共rsa密钥.
任何想法如何使这项工作?
scp(host = "1.2.3.4", path = "/path-to-file", key = "~/../Desktop/id_rsa.pub", user = "admin", keypasswd = "")
^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)
我不使用R,但是你可能在这里使用了错误的密钥文件.当您将密钥文件与ssh客户端一起使用时,通常会提供私钥文件,而不是公钥文件.在这种情况下,您的私钥文件可能名为".../id_rsa"而没有".pub"扩展名.