In case you forgot the root password or can’t login to the CentOS, we can start OS by editing kernel boot options in Grub
When the system is booting press any key (left, right, top, down) on Grub screen
Select the kernel you need to run and press ‘e’ to open the editor
Add text:
rw init=/sysroot/bin/sh
to the line starting “linux /boo/******”
and press Ctrl+x
you will be prompted to init shell where can switch to OS by
chroot /sysroot/
And set a new password for root by typing “passwd”