How to Reset Ubuntu Administrative Password via Command Line

It’s easy to reset a lost administrative password in Ubuntu, but the process to do so isn’t exactly intuitive. Ubuntu, and the various other Canonical Ltd.-recognized derivatives like Xubuntu and Ubuntu Kylin, hash out the root account and default to the first user’s account acting as an administrative one. Therefore you won’t be able to guess the root password, and will have to reset your machine to change the first user account’s password.

You’ll first need to reboot your machine, and then push the left shift key. Timing for hitting this key can be a bit tricky, so sometimes its necessary to restart a couple of times. When you get it correctly, you should receive a GRUB screen, where you can select different options.

Changing a Lost Administrative Password

When you’re at the GRUB menu, hit the down arrow on the keyboard until you’ve selected the second entry down, which should read something like “Ubuntu, with Linux x.xx.x-xx-generic (recovery mode) where the Xs would be filled with the version of the Linux kernel you’re running at the moment.

Push the enter key, and you’ll see a “Recovery Menu” box. Scroll down to “Drop to root shell prompt” with the down arrow and push enter. You have a read-only filesystem, so remount it with mount -rw -o remount / and push enter again. Type passwd followed by whatever your user name is and push enter.

You’ll be prompted to set a new UNIX password. Type it, push enter and then type it again. It should tell you that it has been updated successfully, after which you can reboot and now use your new password fine.

Kevin Arrows
Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Expert Tip

How to Reset Ubuntu Administrative Password via Command Line

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested