This article will explain how to reset your root password in case you've forgotten or lost access to the AlmaLinux system.
For this, you will need direct access to the system. In our case, it is a Virtual Server, so we will be using the VNC feature from CrownPanel.
You will need to enter the GRUB bootloader to perform the password reset.
Enter GRUB Bootloader
- Open the VNC console by navigating to the "VNC" Tab and by clicking on the "Launch VNC" button.
- Reboot the machine by clicking on the "Send Ctrl-Alt-Del" present on the top right corner of the window.
- As soon as the boot process starts, press the
ESCkey to bring up the GRUB Bootloader.
- You will see a GRUB bootloader screen - press "e" to edit the first boot option (If you do not see the GRUB screen, you may need to press any key to bring it up before the machine boots).
Find the kernel line (starts with "linux"), change,
Press CTRL-X or F10 to boot single-user mode.
Enter the system with the command,
passwd to change the root password.
Note: stating that the password entered will not be visible.
Update selinux information.
We will exit the chroot and then reboot the system.
After this, you should now be able to login/access your system with the newly set password.