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

February 25, 2016 663 views
Getting Started

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

1 comment
1 Answer

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.

Have another answer? Share your knowledge.