Monday, August 19

How to reset root password on Redhat Linux or CentOS 5&6

                                                                
Booting straight up to GRUB is not the default boot method for RHEL/CentOS 6.Step by step  process of resetting the root password in RHEL/CentOS 6 Installation.

                 Reset root password on RHEL/CentOS 7

Step1:Boot or Reboot your CentOS/RHEL installation 
       
         From the console ATL+CTRL+DEL will get you start reboot your system.See below image.   
                            

        

Step2.Press Any Key 
     
                 After the reboot, it will come up to a boot countdown like see below image. Here, you can press any key. Then it will go to GRUB menu.     

                        

Step3.GRUB Menu 

              In GRUB menu, select the appropriate kernel version and press the Key "e". Now you will get the options  menu for the kernel version.     
                                           

Step4.Kernel Options Menu

                 From this menu, select the kernel /vmlinuz-... line and press the 'e' key. 
You will now be presented with the kernel boot options.     

                                                  

                                                Step5.Change Kernel Boot Options
              
            Now  add to the end of this line one or  the following: 
               1, s, or single 
And now press Enter key to save your changes.     

                             

Step6.Boot your temporary options
   
                     In this menu, you should already be on the kernel /vmlinuz... line. 
Press the 'b' key to boot to these temporary options to allow you to recover your root account.    
             

                                                 

Step7.Set Root Password 

           Now you will boot up to the root shell and you can use passwd to set your new password.
You will be required to enter the password twice. 

Note:  When u r in single user mode u can't change root password directly. Selinux won't let u change it. To deactivate it u have to type "setenforce 0" after that u can change ur root password.                                      


Once you have completed this, reboot and you have a new root password for your CentOS/RHEL  installation.     
                      

No comments:

Post a Comment

:: Linux - Legends ::