Question

ssh : Permission denied (publickey)

Dear !!

I created droplet 2 weeks ago. I followed the using ssh guide, creating ssh key, adding ssh key for security on digitalocean. I have logined the system everyday since setup.

But Today I try . : ssh root@IP address, I found the following message. Permission denied (publickey).

I searched all question, but not working.

Please help me.

Show comments

Submit an answer

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.

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.

For others looking for more information, refer to this document on the DO Docs: Manually from the Droplet without Password-Based Access Any SSH public keys that you add to you DO account (in Account > Settings > Security tab) are only applied to the droplet when it is created. If you already have a droplet up and running and you are trying to add any additional SSH public keys you will have to follow the article I linked above. It helped me solve the problem of “Permission denied (publickey)”

When I created my very first droplet, I encountered the same error.

The solution was: 0. Generate a keypair in localhost using “ssh-keygen” and press <Enter> for the rest.

  1. Add a public key to your account settings with name “id_rsa.pub”.
  2. Create the droplet after <1>. Make sure to check the checkbox to use existing pub key.
  3. After droplet creation, log in as usual “ssh root@<droplet_ip>”

Hope it helps. Vu