For Dedicated Servers which are managed in the Cloud Panel

In this article you will learn how to reset the root password of a Dedicated Server with AlmaLinux 8, AlmaLinux 9, Rocky Linux 8, or Rocky Linux 9 using the Rescue System.

Requirements
  • The server is switched on.
  • You have created an image of the server in question.

How to reset the root password of your Dedicated Linux Server:

  • 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 Infrastructure > Server area.

  • Click on Actions > Restart.

  • Activate the Rescue System method.

  • Click Yes.

    The server is booted into the Rescue System.

  • Establish a network connection to your server using SSH. The access data is displayed in the Functions section. If you are using the Microsoft Windows operating system, you can use Putty to establish an encrypted connection to your server. Instructions on how to establish an encrypted connection to your server with your computer can be found in the following articles:

    Computers with Windows operating systems

    Computers with Linux operating systems

  • To call up information on all discs, enter the following command:

    rescue:~# fdisk -l

  • Determine the root partition. Pay attention to the size of the partition. The name of the root partition of a dedicated server with software RAIDs is e.g. md126, md125, md127 or md2, depending on the operating system. The name of the root partition of a dedicated server with hardware RAIDs contains the designation sda4. 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, enter the following command:

    rescue:~# mount /dev/MY_ROOT_PARTITION /mnt

  • Replace the placeholder MY_ROOT_PARTITION with the name of the root partition of your dedicated server. Examples:

    Software RAID:

    rescue:~# mount /dev/md125 /mnt

    or

    rescue:~# mount /dev/md126 /mnt

    or

    rescue:~# mount /dev/md127 /mnt

    or

    rescue:~# mount /dev/md2 /mnt/


    Hardware RAID:

    rescue:~# mount /dev/sda4 /mnt

  • For the next steps it is necessary to mount the directories /dev, /proc, and /sys. To do this, enter the following commands:

    rescue:~# mount --bind /dev /mnt/dev

    rescue:~# mount --bind /proc /mnt/proc

    rescue:~# mount --bind /sys /mnt/sys

  • Set the mounted partition to a chroot environment:

    rescue:~# chroot /mnt

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

    rescue:~# passwd

  • Enter the new password and repeat it.

  • Open the Cloud Panel.

  • Click on Actions > Restart.

  • Activate the Current operating system method.

  • Click Yes.

    The server is restarted. You can then log in to the server with the new password.