In this practical we will learn,how to reset forgot root password in CentOS 6.x and Redhat 6.x.
We are doing this practical in CentOS 6.x and it is also applicable to Red Hat 6.x.To reset the root password we will boot the linux system in Runlevel 1 also known as single user mode.

Note: The method is applicable if grub password is not. If you have grub password set then you will not be able to follow the steps which we will describe in this post.We will discuss about grub password in next upcoming post.

To reset forgot root password in CentOS 6.x and Redhat 6.x,follow the given below steps

Step 1: Boot your CentOS/Red Hat linux system and press esc key when you see the message “Press any key to enter the menu” .

reset centos redhat password

Step 2: Now select your operating system if it is dual/multiple boot.Because I have only one Operating system installed,hence selecting CentOS.Now press “e” key from your keyboard. As shown in below given screenshot.

reset-centos6-password-step2

Step 3: Now with the help of arrow key move to second line where “kernel /vmlinuz- has been written. And after this press “e” key

reset-centos6-password-step3

Step 4: Now as per given below screenshot. Only give a space and type numeric 1 . And after this press ENTER key

reset-centos6-password-step4

Step 5: Now you are back to the previous screen. Now press “b” key to boot the system and wait for a few seconds/minutes.

reset-centos6-password-step5

reset-centos6-password-step6

Step 6:
Now by-default root is logged in. The runlevel is 1 (It is also known as single user mode)
Now reset the password by below given command

 passwd root

After resetting the password,now restart the system by command

init 6

reset-centos6-password-step7

Step 7: Let the system get boot normally. After a short time,you will see the login screen. give your new root password and get log in.

Read Some More Articles

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.