Reset Root User Password in Linux (CentOS/RHEL 7.x)
Reset Root User Password by following steps :
If linux system is running, reboot the system for reset the password in Centos/rhel 7.x in following command.
At the boot menu hit “e” key to edit boot entry, and find the linux16 line in the grub option, and add quotes “rd.break” at the end of this linux16 line.
Press Ctrl+x for boot the system, it will boot initramfs prompt.
Now remount the root file system by following command :
switch_root:/#mount -o remount,rw /sysroot
Change into chroot so /sysroot is used as root of the file system :
Reset password by following command :
Update SELinux information as following command :
sh-4.2# exit switch_root:/# exit
System reboot automatically, Now use new password to login.
you can check our new post click here