Report this

What is the reason for this report?

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

Posted on October 21, 2019

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.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.