How to change root password on centos/rhel 7

First reboot your server and then at this stage

Screen Shot 2016-08-09 at 12.50.57 PM

hit “e” to edit

then scroll to the line containing “rghb quiet” and change that entry to “init=/bin/bash”

and then “Crtl x” to start

this takes you into single user mode where you will then issue the below command

Now since root at this point is mounted read only (as confirmed by running mount | grep root), run the below command

# mount -o remount, rw /

and then

change the root password with the passwd command

# touch /.autorelabel

the boot by running

# exec /sbin/init

ALL SHOWN BELOW

Screen Shot 2016-08-09 at 1.07.56 PM

 

Leave a Reply

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