我使用的RCurl
包ftpUpload
功能將文件上傳到SFTP文件服務器。我很難完成驗證呼叫。SSH密碼認證方式在RCurl
下面是我的電話:
ftpUpload(what = "some-file.png",
to = "sftp://some-ftp-server.com:22/path/to/some-file.png",
verbose = TRUE,
userpwd = "my_userid:my_password")
結果我得到:
* About to connect() to some-ftp-server.com port 22 (#0)
* Trying some-ftp-server.com... * connected
* Connected to some-ftp-server.com (some ip address) port 22 (#0)
* SSH authentication methods available: publickey,password
* Using ssh public key file /home/.ssh/id_dsa.pub
* Using ssh private key file /home/.ssh/id_dsa
* SSH public key authentication failed: Unable to open public key file
* Authentication failure
* Closing connection #0
Error in function (type, msg, asError = TRUE) : Authentication failure
我不是一個設置SFTP服務器,我有點一個SSH小白 - 道歉。我所知道的是,我可以在使用my_userid
和my_password
與Filezilla的和服務器有一個.htaccess
和.htpasswd
文件登錄。
我希望有某種方式使用ftpUpload
只有我的用戶名和密碼進行身份驗證。看起來password
是兩種可用的方法之一,但我似乎無法得到ftpUpload
明白,我想單獨使用後者。
.htpasswd
文件似乎包含my_userid:my_password
,儘管密碼部分是加密的。我打算加載在某個地方的ftpUpload
訪問,但我不知道如何指向ftpUpload
在正確的方向。
最後,我試着打周圍,並通過這裏列出的選項的libcurl尋找:http://www.omegahat.org/RCurl/philosophy.html這裏更充分的解釋:http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
唉,沒有運氣。任何幫助感謝!