download files from an sftp server on windows with private key

Hi,

First off all, I have to mention that I'm not an R specialist
I'm trying to download files from an external sftp server and have all the credentials.

I managed to open a session
with the ssh package, where the keyfile is a private key.
session <- ssh::ssh_connect("test@sftp.test.io:22", keyfile = TestPK, verbose = 1)
but now when I try to download the files from a specific folder '/downloads'
with
ssh::scp_download(session, " ~/downloads/*", to = Test.path , verbose = TRUE)

I got the error:
Error: SCP failure: Unhandled message: (84)This service allows sftp connections only.

Can someone provide we with a step by step approach on how to achieve what I want?

Thx,
Bert

You could try with the {curl} or {RCurl} packages. This requires that you have the system package curl installed (should be default on Linux, may require installation on MacOS), but both should support SFTP.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.