Question

How do I add ssh keys to an existing droplet when getting Permission denied (publickey).

Posted October 21, 2019 1.9k views
One-Click Install AppsUbuntu 16.04

I provisioned a One-Click Install Gitlab instance a while ago. Since then, I lost the machine I used to provision the box due to a power surge, thus lost the SSH keys as well.

I am now trying to access the box but I am getting a Permission denied (publickey). I have tried a lot of solutions based on what I could get off the internet but to no success.

Can you please help.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hello, @ditjhabas

You can follow this tutorial in order to upload your ssh key to an existing droplet.

https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/to-existing-droplet/

Let me know how it goes.

You would need to add the key using the DigitalOcean’s console since you’re not able to connect from your local machine.

What you can do is copy the content of your idrsa.pub to the /root/.ssh/authorizedkeys file and then you’ll be able to connect to your droplet.

Let me know how it goes.

  • I have tried logging in using the console on the digitalocean portal but it won’t accept my login credentials, this is even after I have reset the password multiple times.

    • Exactly the same problem here!

      • Can you please check your email and see if the you’ve received the login details? Also please check your SPAM/Junk folders as well. If you haven’t received any emails then I would suggest you to contact our support team.

        Hope this helps.

        Regards,
        Alex

    • Can you please check your email and see if the you’ve received the login details? Also please check your SPAM/Junk folders as well. If you haven’t received any emails then I would suggest you to contact our support team.

      Hope this helps.

      Regards,
      Alex

Submit an Answer