Run CentOS 8 in rescue mode to change root password

In case you forgot the root password or can’t login to the CentOS, we can start OS by editing kernel boot options in Grub

When the system is booting press any key (left, right, top, down) on Grub screen

Select the kernel you need to run and press ‘e’ to open the editor

Add text:

rw init=/sysroot/bin/sh 

to the line starting “linux /boo/******”

and press Ctrl+x
you will be prompted to init shell where can switch to OS by

chroot /sysroot/

And set a new password for root by typing “passwd”

  1. No comments yet.

  1. No trackbacks yet.

You must be logged in to post a comment.