Prerequisites
There are 2 preconditions for using the procedure to reset the administrative password.
-
Physical access to machine.
You need to access the system console in order to interrupt loading of the OS. -
The
rootpassword was disabled.
By default, Ubuntu disables the password of therootaccount by assigning it a value which cannot possibly match any encrypted value. During the installation of Ubuntu, you were asked to create the first user. That initial user, by default, belongs to thesudogroup which means that the user can be elevated to perform system administration functions. The administrative password which we are going to reset refers to the password of the initial user.The procedure assumes that you did not manually assignroota valid password. Ifroothas a valid password and you know it, then you can simply sign on asrootand reset the administrative password using thepasswordcommand. If therootpassword was also forgotten, this procedure does not apply because you need to enter that password to drop torootshell prompt in this procedure.
How to reset administrative password
-
Power recycle.
After the BIOS screen appears, press down theleft shiftkey to enterGRUB. This step can be quite finicky, and you may need to repeat it several times until you get the timing just right. -
Scroll down to
Advanced options for Ubuntu, and pressEnter. -
In the ensuing screen, scroll down to the top
Recovery modeline, and pressEnter.
If the Linux kernel image had been upgraded on the machine before, you would see multiplerecover modelines on the screen. Select therecovery modeline that corresponds to the latest Linux image(that is nearest to the top). -
In the
Recovery Menuscreen, scroll down toroot, and pressEnter. -
Press
Enteragain.
If you have previously assignedroota password, you would be prompted to enter it at this step. Otherwise, just pressEnterto continue. -
Remount filesystem.
After all the hard work, you are now at theroot shell prompt. The filesystem at this point is read-only. Remount the file system to add write permission.# mount -o rw,remount / -
Reset administrative password.
Use thepasswdcommand to change the password for the administrative user.# passwd <adminuser>PressControl-Dto return to therecovery menu. -
Select resume.
-
Exit recovery.
PressOKto exit recovery mode and continue booting.











