Why My SSH Key won't work?

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/ 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).


FYI - I supposed I’ll just add this manually. But maybe the web interface for adding keys only works on new droplets and subsequent keys will not be added to existing/running droplets/instances…

I guess I just wanted to know why this wasn’t working for me…

Submit an 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:


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