One of the worst cases in Linux is when you forget your root password and you have no  users with  root sudo privileges to recover the admin password. let me tel you that can be happen even in the big IT companies .

No worry, there is always a solution to reset new password for your Server.

1-Boot menu

On the Grub boor menu , please select last kenel installed, and press  <e>  to Edit

2- Change boot Settings :

Please find line starting with linux16 and find  string ro

3- change  ro to  rw init=/sysroot/bin/sh.

 

4-Control+X to start machine in Emergency Shell

5 – Switch into a chroot jail, where /sysroot is treated as the root of the filesystem tree

6 –Now you can Reset the password.

7 – Update selinux information to make this permanent

8 – Exit chroot

9 – Reboot your system with command reboot

10- Enjoy the New password :

Cheers!!

Spread the love

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here