meztez / plumberDeploy

Other
53 stars 13 forks source link

Error: Authentication with ssh server failed #27

Closed BrazilForever11 closed 3 years ago

BrazilForever11 commented 3 years ago

Hello,

I installed:

# install.packages("remotes")
remotes::install_github("meztez/plumberDeploy")

created DigitalOcean account and added my SSH public key. Now I run:

id <- plumberDeploy::do_provision(example = FALSE,
                                  region = getOption("do_region", "sfo3"))

and end up with


THIS ACTION COSTS YOU MONEY!
Provisioning a new server for which you will get a bill from DigitalOcean.
Using default ssh keys: work_R_laptop
NB: This costs $0.00744 / hour until you droplet_delete() it
Waiting for create ...................
New server key: 91:52:29:f2:4f:48:52:a9:8e:bd:10:e1:c7:57:b6:5d:00:f2:f9:2f
Error: Authentication with ssh server failed

I can see that droplet is created and can connect to it using Windows Bash.

How do I do SSH authentication from R session? Where do I provide my private key?

meztez commented 3 years ago

Your ssh key needs to be available on your local machine too. You can check this with ssh::ssh_key_info(). Validate that one of the public keys can be found in lapply(analogsea::keys(), '[[', "public_key").

BrazilForever11 commented 3 years ago

@meztez Thank you, it worked!

boral commented 3 years ago

I have installed via github, have ran the code ssh::ssh_key_info() and lapply(analogsea::keys(), '[[', "public_key"). Both gave proper response.

Still after running, I get the following error.

`

id = plumberDeploy::do_provision( 'ubuntu-sakhu', example = FALSE ) Error: Authentication with ssh server failed `

meztez commented 3 years ago

@boral Could you create a new issue with a reprex?

https://reprex.tidyverse.org

Beyond making sure the keys are available both on the local machine and the DO account, it is quite difficult to diagnose.

ries9112 commented 3 years ago

I'm running into the same issue as @boral and I'm not sure how one would provide a reprex in this case. At first I was running into an issue because my local ssh key and the DigitalOcean one weren't the same:

image

Now I made sure my R session and the DigitalOcean one match, but I'm still getting the Error: Authentication with ssh server failed:

image

Any thoughts around what I may be doing wrong here? I think the command is working correctly but running into a problem installing apt-transport-https because the DigitalOcean mirror for the download is just not working. See this issue on the topic: https://www.digitalocean.com/community/questions/digitalocean-mirrors-failing

It seems like the required fix would probably be to replace “mirrors.digitalocean.com” with “archive.ubuntu.com”, but I have no clue how to make the change and use the plumberDeploy package with the change applied.

meztez commented 3 years ago

This another error not related to ssh key and discussed in https://github.com/meztez/plumberDeploy/issues/31.

You can use the development version to get around this. You did nothing wrong, it has something to do with DO ubuntu image.

ries9112 commented 3 years ago

Apologies, I ended up on this thread because the error referenced matched what I got and googled and I missed that one. Works great on the development version, thank you very much! This is great, thank you for making & maintaining this package

meztez commented 3 years ago

All thanks should go to @trestletech and @muschellij2. I'm just making sure nothing serious breaks.