Report this

What is the reason for this report?

How to reset ubuntu user password without root login (root login disabled)?

Posted on February 25, 2016

for some strange reason, after installed some apps and rebooted,user password became invalid. Now i cannot execute sudo because the same password is deemed invalid. I can login user with SSH keys but no sudo. Root login disallowed via sshd_config (PermitRootLogin no) Am i locked out?:(



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!

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 are not. You have two options to proceed:

1.) If your root user has a password you can try logging in directly via the console in the control panel. Your droplet considers this a local login and it does not depend on ssh so the PermitRootLogin setting has no affect here.

If this doesn’t work or you have an ssh key for your root user…

2.) Open a ticket with our support team and request they mount the Recovery ISO on your droplet. This is a Debian based Live CD image that will allow you to boot your droplet, mount your droplet’s filesystem, reset your root password and perform other maintenance. Once booted you can select the menu item to mount your disk and then drop to a command prompt in order to edit your ssh configuration.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.