Reset Root Password CentOS 7

Scenario: Reset root password CentOS/RHEL 7
System: CentOS/RHEl 7

1) On first boot menu select first kernel(on top) then Press ‘e’

2) Change ro with rw init=/sysroot/bin/sh

3) On single user mode,follow command in picture below.
# chroot /sysroot
# passwd root
# touch /.autorelabel
# exit
# reboot

4) After reboot you can login to root using new password.


Leave a Reply

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