LinuxUnix

Reset root password in CentOS 7

Posted

https://www.unixmen.com/reset-root-password-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.

chroot /sysroot

6 – Reset the password.

passwd root

7 – Update selinux information

touch /.autorelabel

8 – Exit chroot

exit

9 – Reboot your system

reboot

Leave a Reply

Your email address will not be published. Required fields are marked *