Access droplet with ssh key

I’m trying to access my droplet through cmder with an ssh just set up in digital ocean, but get the message “root@droplet ip: Permission denied (publickey)”. How do I get through?

Submit an answer
Answer a question...

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!

Sign In or Sign Up to Answer

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.

Site Moderator
Site Moderator badge
October 2, 2022

Hello @sub359

You can also check this tutorial on how to add your ssh key to an already existing droplet


Site Moderator
Site Moderator badge
October 2, 2022

Hi @sub359,

Well, it seems like that for some reason your Droplet can’t match a your public and private keys.

The first option would be that you need to add the SSH key on your Droplet. To add the SSH key, on your laptop, copy the contents of your file, you’ll need to place it on the Droplet, in ~/.ssh/authozired_keys. To get access you can check this link:

The other option would be that when you try to SSH to your Droplet, your Key is not loaded. What you can try to do is:

  1. ssh -i /path/to/ssh/ root@IPAddress

See if that works. Where /path/to/ssh/ is the actual path to your SSH key.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.