从curlOptions和运行的 R 文档中,listCurlOptions()
它看起来keypasswd
就是您正在寻找的东西。
编辑/更新:我尝试将此选项添加到我自己的代码中并运行它,它对我来说效果很好。您的最终调用应如下所示:
ftpUpload(what = pathtofile,
to = serverlocation,
verbose = TRUE,
.opts = list(
ssh.private.keyfile = pathtokey,
keypasswd = passphrase
))
您的输出应该类似于:
* Trying 123.456.789…
* TCP_NODELAY set
* Connected to 123.456.789 (123.456.789) port 22 (#0)
* SSH MD5 fingerprint: abcdefghij123456789
* SSH authentication methods available: publickey
* Using SSH public key file '/Users/User1/.ssh/id_rsa.pub'
* Using SSH private key file '/Users/User1/.ssh/id_rsa'
* Initialized SSH public key authentication
* Authentication complete
* Connection #0 to host 123.456.789 left intact
OK
0