5

I'm trying to connect to a SFTP server. It is an encrypted server that uses FIPS mode. I am able to connect and perform file transfer through WinSCP, FileZilla, and through bash sftp commands with no problems.

But, I cannot, access this same SFTP from R using RCurl (R version=3.3.2, RCurl version=1.95-4.10, windows 10). This is what my code looks like and the error message that is being produced:

RCurl::ftpUpload(what="path/to/my/local/file.ext",
                 to = "sftp://my.eftp.server:portNumber/path/to/my/file.ext",
                 userpwd = "user:password",
                 .opts=curlOptions(verbose=TRUE))

The error message is:

*   Trying ###.###.###.##...
* Connected to my.eftp.server (###.###.###.##) port ## (#0)
* Failure establishing ssh session
* Closing connection 0
  Error in function (type, msg, asError = TRUE)  : 
  Failure establishing ssh session

Any help would be wonderful. I've referenced the following with no luck: sftp with R - sftp not a protocol with RCurl, Using RCurl with SFTP and the RCurl documentation (and other links).

I've also tried:

RCurl::ftpUpload(what="path/to/my/local/file.ext",
                 to = "sftp://user:password@my.eftp.server:portNumber/path/to/my/file.ext",
                 .opts=curlOptions(verbose=TRUE))

Also, I've checked my curlVersion()$protocols and scp and sftp protocols are listed (with the others).

Dania
  • 305
  • 2
  • 10

0 Answers0