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
root
password was disabled.
By default, Ubuntu disables the password of theroot
account 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 thesudo
group 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 assignroot
a valid password. Ifroot
has a valid password and you know it, then you can simply sign on asroot
and reset the administrative password using thepassword
command. If theroot
password was also forgotten, this procedure does not apply because you need to enter that password to drop toroot
shell prompt in this procedure.
How to reset administrative password
-
Power recycle.
After the BIOS screen appears, press down theleft shift
key 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 mode
line, and pressEnter
.
If the Linux kernel image had been upgraded on the machine before, you would see multiplerecover mode
lines on the screen. Select therecovery mode
line that corresponds to the latest Linux image(that is nearest to the top). -
In the
Recovery Menu
screen, scroll down toroot
, and pressEnter
. -
Press
Enter
again.
If you have previously assignedroot
a password, you would be prompted to enter it at this step. Otherwise, just pressEnter
to 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 thepasswd
command to change the password for the administrative user.# passwd <adminuser>
PressControl-D
to return to therecovery menu
. -
Select resume.
-
Exit recovery.
PressOK
to exit recovery mode and continue booting.
No comments:
Post a Comment