Reset root password (AlmaLinux 8 and 9 and Rocky Linux 8 and 9)
Please use the “Print” function at the bottom of the page to create a PDF.
For Cloud Servers which are managed in the Cloud Panel
In this article you will learn how to reset the root password of a Cloud Server with AlmaLinux 8, AlmaLinux 9, Rocky Linux 8, or Rocky Linux 9 installed.
Note
If you did not set your own password when creating the server and have not changed the automatically assigned initial password, you can display the initial password in the Cloud Panel.
Start KVM console
- Log in to your IONOS account.
Click Menu > Servers & Cloud in the title bar .
Optional: Select the desired Server & Cloud contract.Activate the desired server in the Cloud Panel in the Infrastructure > Server area.
To start the KVM console, click on Actions > Start KVM console.
The KVM console opens in a new tab.Switch to the Cloud Panel.
Make sure that the desired server is activated. Then click on Actions > Restart.
Select the Hardware method and click Yes.
Immediately switch to the tab in which the KVM console is open.
Click the right mouse button and immediately hold down the Shift key to open the Grub start menu.
Press the [E] key to edit the startup entry.
Notes
- When calling up the Grub start menu, the Shift key must be pressed immediately after the restart. If you see the VMware logo, you have missed the point at which you can call up the Grub start menu.
- On some servers, you may have to press the Esc key instead of the Shift key.
Customise GRUB start menu
Add the following parameters to the end of the line that begins with the character string linux ($root)/:
rd.break enforcing=0
The line should now look something like this:
AlmaLinux 8 and Rocky Linux 8linux ($root)/vmlinuz-4.18.0-513.18.1.el8_9.x86_64 root=/dev/mapper/almalinux-\ root ro crashkernel=auto resume=/dev/mapper/almalinux-swap rd.lvm.lv=almalinux/root rd.l\ vm.lv=almalinux/swap rd.break enforcing=0
AlmaLinux 9 and Rocky Linux 9linux ($root)/vmlinuz-5.14.0-362.18.1.el9_3.x86_64 root=/dev/mapper/almalinux-\ root ro crashkernel=1G-4G:192M, 4G-64G:256M, 64G-:512M resume=/dev/mapper/almali nux-swap rd.lvm.lv=almalinux/root rd.lvm.lv=almalinux/swap selinux=0 rd.break enforcing=0
initrd ($root)/initramfs-5.14.0-362.18.1.el9_3.x86_64.img- The parameter rd.break causes the boot process to be interrupted before control is transferred from initramfs to systemd. This means that the initramfs prompt can be used for command input.
- The parameter enforcing=0 puts SELinux into permissive mode. This saves the later - possibly very time-consuming - re-labelling of the file system, which would be necessary if SELinux were switched off.
- Press Ctrl+x to boot the system with the changed parameters.
- The switch_root prompt of initramfs is displayed.
Note
If the file system is encrypted, it is possible that the prompt for entering the password is overlaid by the system messages and is therefore not visible. In this case, briefly press the Backspace key. The prompt should now be displayed again.
Change password
As the file system under /sysroot/ is only mounted with read rights, you must first remount it with write rights:
switch_root:/# mount -o remount,rw /sysroot
Now switch to a chroot environment:
switch_root:/# chroot /sysroot
The prompt changes to sh-4.4#.Now you can change the password via passwd:
sh-4.4# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfull
Note
If passwd aborts with the message Authentication token manipulation error, you must exit the chroot environment again and remount /sysroot with write permissions as described in the previous step.
To exit the chroot environment, enter the following command:
exit
Reboot the server. To do this, enter the following command:
reboot -f
The server reboots into the normal system. You can then log in with your new password.