CentOS 7: Single User Mode


In the boot grub menu select option to edit.

Select Option to edit (e).

Go to the line of Linux 16 and change ro with rw init=/sysroot/bin/sh.

rw init=/sysroot/bin/sh

Now press Control+x to start on single user mode.

Now access the system with this command.

chroot /sysroot

Reset the password.

passwd root

Update selinux information

touch /.autorelabel

Exit chroot


Reboot your system

Used this – https://www.unixmen.com/reset-root-password-centos-7/