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 :
- Advertisement -
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
chroot /sysroot
6 –Now you can Reset the password.
passwd root
7 – Update selinux information to make this permanent
touch /.autorelabel
8 – Exit chroot
exit
9 – Reboot your system with command reboot
reboot
10- Enjoy the New password :
Cheers!!
- Advertisement -
Subscribe
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"