Edit boot menu on-the-go

0. reboot the CentOS 7 and press ESC when GRUB menu show up on the screen and press “e”
1. find “ro” on “linux16” section and then change to “rw init=/sysroot/bin/sh”
2. press “CTRL + x” to reboot CentOS to init sh mode and start to reset root password

chroot sysroot

after booting on init sh mode, run this command:

reset root password

reinitial selinux

exit from chroot

reboot CentOS 7