Report this

What is the reason for this report?

Why My SSH Key won't work?

Posted on September 13, 2019
West

By West

So, I’ve set up quite a few SSH Keys, but my latest key doesn’t seem to be working. I’ve done what I’ve always done; copied the key directly from ~/.ssh/id_rsa.pub and pasted it into the Key(s) section on the Security Page in my DigitalOcean account panel.

This is the second key i’ve added, the first key still works. I’ve even tried restarting the service (even though I’ve never had to do that before).

I’m sure it’s my fault, something like I’ve just forgotten a simple step…

[USER]@[DROPLET-DOMAIN]; Permission denied (publickey).



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 comment is correct, the key(s) installed on the droplet only happen on creation - adding new keys is not retroactive.

If you want to add the new key, you would add the private jey contents to your authorized_keys file, normally found here:

~/.ssh/authorized_keys

For root user, that is /root/.ssh/authorized_keys - it should already exist with the key it was assigned on creation. Copy the private key contents, the same that you pasted into the web cloud UI, and add them to the end of that file - then it should work.

Hope this helps and good luck!

Hi @TacticalDeveloper,

This error means the server actually reads the SSH key but finds some issues with it.

I’ll recommend checking THIS article on possible solutions.

Kind regards, Kalin

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.