Cannot login after resetting root password

I am trying to access my server terminal from my new computer. I tried adding an ssh key by following the guide, but I get the Permission denied (publickey) error. I then turned to the browser console but can only use the Recovery Console because the Droplet Console for native-like terminal access has not been set up. Unfortunately I forgot my password so I have had to Reset Root password. I get the email and enter the recovery password, enter that, create a new password. But now its not accepting my new password.

Where do I go from here?

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.

Site Moderator
Site Moderator badge
November 7, 2022

Hello there,

Make sure to enter the password without blank spaces and also try to type it manually as copy/paste might not be working.

Once you can access the droplet via the recovery console you can temporarily enable password authentication and then upload your ssh-key. You can later on again disable the password-authentication.


Site Moderator
Site Moderator badge
October 21, 2022

Hi @nicholasjames,

The Recovery Console should be enough for you in this case. You can check this tutorial on how to use it:

Using the Root password should be done in the recovery console and then you can add the proper SSH key or allow PasswordAccess for your Droplet from the sshd_config located in /etc/ssh/sshd_config. If you make any changes there, don’t forget to restart the sshd service:

  1. service sshd restart

Hi @nicholasjames,

I am very sorry for what happened.

I have found a very interesting video that explains the process to follow for How To Reset Your DigitalOcean Droplets Root Password.

Hope that helps you,

Sergio Turpín

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.