Valid for Dedicated Servers and Bare Metal Servers running AlmaLinux 8, 9, and 10, Rocky Linux 8, 9, and 10, Ubuntu 24.04, and Debian 13 which are managed in the Cloud Panel.

In this article, you will learn how to reset the root password of a Dedicated Server or a Bare Metal Server using the Rescue System for netboot.xyz.

Requirements

  • The server is powered on.
  • You have created an image (backup) of the respective server.

How to reset your server's root password:

  • Log in to your IONOS account.
  • Click on Menu > Servers & Cloud in the title bar. 
    Optional: If you have multiple server contracts, select the desired contract.

  • In the Infrastructure > Servers section, select the desired server.
  • Click Actions > Restart.
  • Select the Rescue System netboot.xyz latest method.
  • Click Yes. The server will now boot into the rescue system.
  • Establish an SSH connection to your server. The connection credentials will be displayed in the Functions section. If you are using Microsoft Windows, you can use PuTTY to establish an encrypted network connection to your server. You can find instructions on how to establish an encrypted connection to your server from your computer in the following articles:
    Establishing an SSH connection to your Linux server from a Microsoft Windows computer
    Establishing an SSH connection to your Linux server from a Linux computer
  • To retrieve information about all storage drives, enter the following command:

    rescue:~# fdisk -l

  • Identify the root partition by looking at the partition sizes. On Dedicated Servers with Software RAID, the root partition name varies depending on the operating system (e.g., md126, md125, md127, or md2). On servers with Hardware RAID, the designation is often /dev/sda4. On NVMe drives, it might be something like /dev/nvme0n1p3.

    Examples:

    Software RAID:

    Disk /dev/md125: 888.66 GiB, 954195574784 bytes, 1863663232 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 131072 bytes / 131072 bytes

    Hardware RAID:

    /dev/sda4 11718656 1874327551 1862608896 888.2G Linux filesystem

  • To mount the root partition, adjust and enter the following command. Replace the placeholder MY_ROOT_PARTITION with the actual name of your Dedicated Server's root partition:

    rescue:~# mount.real -o inode32 /dev/MY_ROOT_PARTITION /mnt

    Examples:

    Software RAID (AlmaLinux and Rocky Linux):

    rescue:~# mount.real -o inode32 /dev/md125 /mnt

    or

    rescue:~# mount.real -o inode32 /dev/md126 /mnt

    or

    rescue:~# mount.real -o inode32 /dev/md127 /mnt

    or

    rescue:~# mount.real -o inode32 /dev/md2 /mnt

    Software RAID (Ubuntu and Debian)

    rescue:~# mount.real -o inode32 /dev/md127p1 /mnt

    Hardware RAID:

    rescue:~# mount.real -o inode32 /dev/sda4 /mnt

  • For the subsequent steps, it is necessary to mount the /dev, /proc, and /sys directories. Enter the following commands:

    rescue:~# mount.real -o inode32 --bind /dev /mnt/dev

    rescue:~# mount.real -o inode32 --bind /proc /mnt/proc

    rescue:~# mount.real -o inode32 --bind /sys /mnt/sys

  • Change to the root directory environment (chroot) of the mounted partition:

    rescue:~# chroot /mnt

  • To set a new password, enter the following command:
    For the root user:

    rescue:~# passwd

    For a specific user:

    rescue:~# passwd USERNAME

  • Enter the new password and repeat it to confirm.
  • If SELinux is enabled (default on Rocky/AlmaLinux), execute the following command to ensure files are automatically relabeled on reboot:

    rescue:/# touch /.autorelabel

  • Exit the chroot environment:

    rescue:/# exit

  • Safely unmount all directories recursively:

    rescue:~# umount -R /mnt

  • Open the Cloud Panel.
  • Click Actions > Restart.
  • Select the Current Operating System method.
  • Click Yes.

The server will reboot normally. Once up, you can log in to the server using your newly configured root password.