從R的文檔curlOptions和運行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