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:
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+Xand at the boot prompt typelinux singleand press enter. Then proceed to step 4.
GRUB prompts you for commands to add to its defualt boot command.
singleLinux 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#
paswrd command to change the root password as follows:
sh-2.05b# passwd
Changing password for root user.
New password:
root password that you want to use (it doesn’t appear on screen) and then press enter.Linux asks for the password again, like this:
Retype new password:
If you enter the same password both times, the
passwrdcommand changes therootpassword.
After linux starts, it displays the familiar login screen. Now you can log in as
rootwith the new password