To perform a system administrator task, you have to know the root password. What happens if you forgot your root password? Not to worry. Just reboot your PC and you can reset the root password by following these steps:
- Reboot the PC(select reboot as you log out the of the GUI) or power up a usual.
Soon you see the graphical boot loader on screen that shows the name of the operating systems you can boot. If your system runs with LILO boot loader, press
Ctrl+X
and at the boot prompt typelinux single
and press enter. Then proceed to step 4.[ad#squere-ads]
- If you have more than one operating system installed, use the arrow key to select linux as operating system, then press the A key.
- Press the spacebar, type the following, and press enter:
- Type the
paswrd
command to change theroot
password as follows: - Type the new
root
password that you want to use (it doesn’t appear on screen) and then press enter. - Type the new password again, and press enter.
- Now type reboot to reboot the PC.
GRUB prompts you for commands to add to its defualt boot command.
single
Linux starts up as usual but runs in a single-user mode that do not require you to log in. After linux starts, you will see the following command line prompts that ends with a hash mark (#), similar to the following :
sh-2.05b#
sh-2.05b# passwd
Changing password for root user.
New password:
Linux asks for the password again, like this:
Retype new password:
If you enter the same password both times, the
passwrd
command changes theroot
password.
After linux starts, it displays the familiar login screen. Now you can log in as
root
with the new password
[ad#squere-ads]