How to access to Droplet If private Key is Lost

How I will access to droplet if I loose my private key. I am running Ubuntu 14 and Given “No” to Password Authentication.

Please help me understand that what I have to do if I loose my private Key


Start off by resetting your password. It should be emailed to you and then simply go into your profile and add another key. A couple of screenshots to get you on your way. I’d Google (or whichever search engine you prefer) how to do this though. You’ll resolve your issue much sooner that way than waiting for someone to respond on such a question.

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 have two options, if you have a system user with a password set (even though SSH Password Auth is off) then you can use the Web Console to access it, as this is like accessing the server physically and thus only supports passwords. Your other option is the Recovery Kernel (or Recovery Distro, for which you have to ask Support to enable this for you) The Recovery Kernel you can enable yourself, you can mount your partitions and add your new Public key using this. Use this guide, for how to enable this kernel, the fsck stuff is unrelated:


In this case, you would need to log in via the web console available in your DigitalOcean Cloud account area for that droplet.

Much more info can be found here:

In order to enable Password level authentication, you can follow these steps.

  1. Type sudo nano /etc/ssh/sshd_config
  2. Change PasswordAuthentication from “no” to “yes” and save the file
  3. Open a terminal on your computer and type ssh username@[hostname or IP address] or if on a Windows box use PuTTY for password login making sure authentication parameters aren’t pointing to a private key
  4. Login with a password
  5. Type sudo nano ~/.ssh/authorized_keys
  6. Paste public key text here and save the file
  7. Type sudo nano /etc/ssh/sshd_config
  8. Change PasswordAuthentication from “yes” to “no” and save the file
  9. Restart the ssh service: sudo systemctl restart sshd

Regards, Alex