Sep 15 2009

Reset Linux root password

Scenario : Linux admin forget root password. How to reset the root password?

 Solution :

There are two different Boot Loader GRUB and LILO

1.LILO Boot Loader

Step 1:

Reboot the linux box while coming up hit space bar now type  1 (Single user mode) and press enter.

or

At the Boot: prompt displayed by the LILO boot loader, type linux single and press the [ENTER] key:

         This will take into single user mode without asking you root password. Just reset the root password and reboot the machine.

Step 2:

Allow the system boot and when it displays the # prompt, type passwd to reset the root password

GRUB Bootloader

Step1 : Reboot the machine 

Select the line which specifies the kernel to be loaded.

Press the ‘e’ key to edit the entry.
Step 2 :

Choose second line (the line starting with the word kernel).
Press the ‘e’ key again to edit kernel entry
Step 3:

Append the letter ‘S’ or word ’single’ to the end of the line.
Press the [ENTER] key
Step 4:

Press the ‘b’ key to boot the Linux kernel into single user mode
After the booting process completes, mount the ‘/’ and ‘proc’ partitions using the below listed commands.

# mount -t proc proc /proc
# mount -o remount,rw /

Issue the ‘passwd’ command to change the root password.

Finally, reboot the system employing the below commands.
# sync
# reboot

        Have a nice day and dont ever forget the root password.

Comments are closed.

Alibi3col theme by Themocracy