Forgot root password ,Reset it in Run level 1
This is my first post in my blog.The question always ask by student is how to reset root password in Linux if they forgot the password.This is not a big task to reset root password if grub password is not set.Here I am trying to give my best way to tell how to reset root password in Red Hat Enterprise Linux 5.x
step(1) : Start your Machine/PC and press any key when the Linux O.S is just started.You will get a first red colour screen with showing countdown time in seconds.When you will press any key you will get a screen like below given picture.
step(2) : Now press key “e” from your keyboard.(note: If your system has 2 or more O.S then select the “Red Hat Enterprise Linux Server” option as you are getting on above picture and then press key “e”)
step(3 ) : after pressing “e” key you will get the screen like this(see below picture)
step(4) : Select option “kernel /boot/vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quit”.And press again key “e” from your keyboard
From above lines, “2.6.18-8.el5” is Linux kernel version.So do’nt get confused it vary if you are using different version of Redhat Linux.
step(5) : After that you have to only type 1 with space.And then press ENTER from your keyboard.(See the below picture)
step(6) : After that you will be by-default back to your screen.Now you have to press key “b” from your keyboard.The system will go for booting in runlevel 1.
step (7) : After booting you will get a black screen.Now here we go to change the root password.
For changing the password.We will use command “passwd” .
After using this command it will ask you to type and retype the password of root.Type your desired password.(linux do not show anything while typing any user password so do nt get confused)
After giving your password reboot your system.For rebooting type command “init 6”
(See the below picture for this step)
step (8) : Now check your password.After sucessfull reboot.
Note: The above screen shows when the Linux operating system is running in run level 5.