This article will teach you how to reset a forgotten root password from the GRUB menu if you are running AlmaLinux 9.
Please note that if you are running AlmaLinux 8, the instructions differ a bit, and we have a separate guide here: How to Reset Your Root Password in AlmaLinux 8
First, login to GleSYS Cloud and navigate to the virtual machine in question.
The next step is to reboot the server. You can do that by clicking Reboot
in the dropdown menu called Actions or by opening a Console
from the same place and pressing Ctrl-Alt-Del
in the console view.
Picture below: When rebooting, the GRUB menu will appear, and to edit the boot parameters, step down with the arrow key to AlmaLinux (0-rescue-...) 9.0 (Emerald Puma)
and press the key 'e.'
Picture below: This is your current boot parameters. Step down to the second last text line starting with 'linux' and delete ro no_timer_check
.
Picture below: You replace this with rw init=/sysroot/bin/sh
. Then press Ctrl-x to boot up the server.
Picture below: When the screen with Press Enter for maintenance
appears, you hit Enter.
To set a new root password, run the following commands:
:/root# chroot /sysroot
:/# passwd
Output
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Finally, run the following commands to reboot the server:
:/# touch /.autorelabel
:/# exit
:/root# reboot
Be prepared that the auto-relabel process can take some time to complete. Then, when the server has booted again, you log in with your new root password!
Kontakta oss gärna för mer information. Vi hjälper dig att komma fram till den bästa lösningen för dina behov.