Reset root password on RHEL/CentOS 6
Step1: Boot or Reboot your CentOS/RHEL Server
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.
Step2: 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.
Step3: Change Kernel Boot Options
To enter into single user mode; Go to second last line (Starts with linux16 or linuxefi) using up and down arrow then modify the ro argument.
Modify it to “rw init=/sysroot/bin/sh”. Once done, press “Ctrl+x”
Now you should be in command line mode with root privileges (without entering password). Now you can start to troubleshoot your system or can do maintenance of your system.
Step4: Set Root Password
chroot to access your system.
Reset the root password
Update SELinux information
Step5: Reboot your server
Once you have completed this, reboot and you have a new root password for your CentOS/RHEL Installation.
#reboot (or) init 6
you can use rd.break instead of init=ReplyDelete
This way is also good and rd.break is also good thanks for such a nice explanationReplyDelete