Reset the Root Password on AlmaLinux
Last Updated: Tue, Feb 22, 2022 FAQ Troubleshooting Guides
Using a Different System?
If you are locked out of your AlmaLinux instance and have lost access to the root account, you need to boot into single-user mode and reset the root password.
As the system boots, press ESC to bring up the GRUB boot prompt. The prompt happens early in the boot process. If you miss the prompt, you need to restart the server from the control panel and try again.
At the GRUB boot prompt, press E to edit the first boot option.
Find the kernel line starting with linux.
Change ro to rw init=/sysroot/bin/sh.
Press CTRL+X or F10 to boot into single user mode.
Access the system with the command: chroot /sysroot.
Type passwd and follow the prompts to change the root password.
Run touch /.autorelabel to force file system relabeling. This is required for systems with SELinux. When you reboot the system, it will relabel the filesystem for SElinux. The reboot may take extra time during this process.
Run reboot to reboot the server.
FoldFold allExpandExpand allAre you sure you want to delete this link?Are you sure you want to delete this tag?
The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community