Read files from AWS (Amazon Lightsail) with R

Viewed 40

I need to download files from Amazon Lightsail to R.

I tried to use sftp connection, but nothing worked.

I have an ip, user name and key in .cer file. (RSA PRIVATE KEY)

library(RCurl)

protocol <- "sftp"
server <- "01.01.01.01"
file <- "//home/ubuntu/statistics/data/2022-01-23.xlsx"
url <- paste0(protocol, "://", server, file)

ssh.private.keyfile = "key.cer"
username <- "ubuntu"

data <- getURL(url = url, ssh.private.keyfile = ssh.private.keyfile, username = username, verbose = TRUE)
0 Answers
Related