How to Reset a Lost Administrative Password in Ubuntu
Table of Contents
Forgetting your Ubuntu administrative (sudo) password can be frustrating. It locks you out of system updates, software installation, and crucial configuration changes. Fortunately, Ubuntu provides several methods to reset your password and regain access to your system.
How to Reset a Lost Password in Ubuntu
For Xubuntu 14.04 and other Ubuntu versions:
Just follow the screens below:
1. Press ESC, and choose Advanced options

2. Choose recovery mode:

Using the arrow keys scroll down to root and then hit Enter.
You should now see a root prompt, something like this:
root@ubuntu:~#

Detailed Root Shell Instructions
At this stage you should have a read-only filesystem. You have to remount it with write permissions: type the following command and hit Enter.
mount -o remount,rw /
Now we can set the user's password with the passwd command. (In this example I will use jorge as the example, you need to substitute whatever the user's username is):
root@ubuntu:~# passwd {usernameforwhomyouwanttoresetpassword} Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully root@ubuntu:~#
Type in what you want the new password to be at the prompt. After it's successful reboot the machine and the user will be able to log in with their new password.
Now the password should be reset. Type exit
to return to the recovery menu.
root@ubuntu:~# exit
After you get back to the recovery menu, select resume normal boot, and use Ubuntu as you normally would — only this time, you actually know the password!
Tip: In step 5, it may help to remove "ro" if present, while adding "rw".
Other resources:
Security Note
Some may be concerned about this being a security vulnerability. It is not. You need to have physical access to the machine to perform this procedure. If someone has physical access to your PC, they could do far worse than change a password.
When it comes to physical access, the battle for security is largely lost. Be wary of who you allow to use your computer.
Conclusion
Forgetting your Ubuntu administrative password doesn't mean you're permanently locked out of your system. As we've seen, Ubuntu provides multiple ways to reset your password and regain access to your system.
The Recovery Mode method is the simplest and should work for most users, but if you encounter any issues, the alternative methods using Live USB/CD or GRUB modifications can help you recover access.
Remember, having physical access to a computer generally means security can be bypassed. This is why it's important to implement additional security measures like disk encryption if you have sensitive data on your computer.
Leave a Comment