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

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?:(

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.

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.