HOW TO RESET FORGOTTEN LINUX ROOT PASSWORD ON REDHAT/CENTOS 4/5/6
In this article we are going to learn how to reset forgotten root password on RHEL/CentOS/Fedora 5/6 or earlier versions. As a Linux Administrator some time we face challenges when some how we forgot the root password and without root access we can’t do any kind of administrative task’s in Linux.But luckily there is a easy way to recover the forgotten password.
Follow the Steps below to Reset the Forgotten root Password:
Step: 1 Edit the Main Menu
Restart the system and press any key to interrupt the normal boot process to use the menu before it enters in to the Operating System.
After interrupt the normal boot process system will allow us to use the menu to edit the grub so that we can recover the root password.
As we can see the system is allowing us to edit the menu by press “e“. So press “e” to go toward next step.
Note :- If you have protected your GRUB by password then it will ask to press “p” to enter the password to unlock the GRUB and then it will allow to edit the menu by pressing “e“.
Step: 2 Edit the Kernel Argument
After the main menu now we moved to a new page where we have to edit the kernel argument by pressing “e“, As we can see in the snapshot above the Kernel argument is there on second line.
Note : -We can move the cursor by UP and Down arrow on the keyboard.
So select the second line as selected above on the snapshot and press “e” to edit the kernel argument.
As we can see after edit the kernel argument we are able to make changes in the line.
Also Read :
Step: 3 Configure for Single User-Mode Booting
So remove the rhgb quiet type single as shown in the snapshot above and then press ENTER.
After make changes the line would look like this as shown in the snapshot above.
Now as shown on the snapshot above select the kernel line and press “b” to boot Operating System in a Single User Mode.
Now it will take to the shell prompt.
Step: 4 Set the Password for Root
At shell prompt just type below command to reset the password.
$ passwd root # To reset the root password
So this is how we can reset forgotten linux root password.
If you found this article Useful then Like It, Share It or Subscribe us For Updated Linux Guides and Tutorials. If you have some thing to say then feel free to Comment on the Comment box below.