meztez / plumberDeploy

Other
50 stars 12 forks source link

Error: Authentication with ssh server failed #9

Closed MislavSag closed 3 years ago

MislavSag commented 3 years ago

If I use droplets function from analogsea package, I get the output as expectsd:

$`ubuntu-s-1vcpu-2gb-fra1-01`
<droplet>ubuntu-s-1vcpu-2gb-fra1-01 (208129169)
  IP:        68.183.220.71
  Status:    off
  Region:    Frankfurt 1
  Image:     20.04 (LTS) x64
  Size:      s-1vcpu-2gb
  Volumes:   

but if I try:

plumberDeploy::do_provision(208129169)

I get an error:

Error: Authentication with ssh server failed

If I got it right, both functions require ssh, but it works with first and not with second?

meztez commented 3 years ago

You do not need ssh for the first one since it uses your DO credentials to list droplets. Only the second one use ssh. Have you up your ssh key on DO?

https://github.com/sckott/analogsea see Authenticate section.

MislavSag commented 3 years ago

Yes. I have done the following:

  1. I have created .Renviron file:
    DO_PAT='my api key'
  2. generate ssh using putty gen and save private key.
  3. copy paste public key yo DO SSH, that is genrate SSH key in DO

I can see key in .ssh folder: 68.183.220.71 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJV7SfnS7Uqaz54dBu8JdfWNq/C1QKw20k9CPdglG5bj

meztez commented 3 years ago

I'm unable to replicate the error, sorry.

Can you provide a code sample that replicates the error on your and the content of sessionInfo()

MislavSag commented 3 years ago

I have finally solved the issue. I have created a new droplet and define a new ssh key while I was making a new droplet and not just in the settings!

I am waiting right now do_provision to finish. I hope it would work.

meztez commented 3 years ago

When you do that, you have to explicitly provide your ssh keys to do_provision because they can not be autodetected.

MislavSag commented 3 years ago

How can I "provide my ssh keys"? I don't see argument in the function for ssh keys. Is this connected with this: https://github.com/meztez/plumberDeploy/issues/10?

meztez commented 3 years ago

Throught ... in do_provision see ?analogsea::droplet_create ssh_keys parameter.

If your droplet was alreay created, you would have to add the ssh_keys to your droplet manually. Which is out of scope for this package. Better to add the ssh keys first to your DO account, then run do_provision.

MislavSag commented 3 years ago

So I should:

  1. add SSh key to DO
  2. crete new droplet and choose SSH key from 1
  3. run plumberDeploy::do_provision(dropletid) ?