How To Reset Root Password On CentOS 7

The way to reset the root password on centos7 is totally different from Centos 6. Let me show you how to reset the root password in CentOS 7.

1 – In the Boot Grub Menu Select Option to Edit

Selection_003

2 – Select Option to edit (e)

Selection_005

3 – Go to the line of Linux 16 and change ro with “rw init=/sysroot/bin/sh”

Selection_006

4 – Now press “Control+x” to start on single user mode

Selection_007

5 – Now access the system with this command

chroot /sysroot

6 – Reset the password

passwd root

7 – Update selinux information

touch /.autorelabel

8 – Exit Chroot

exit

9 – Reboot your system

reboot

That’s it. Enjoy.