Valid for VPS+, VPS, and migrated Cloud Servers running Debian 11, Debian 12, Debian 13, Ubuntu 22.04, and Ubuntu 24.04 that are managed in the Cloud Panel.

In this article, you will learn how to reset the root password of a VPS+, a VPS, or a Cloud Server with Debian 11, Debian 12, Ubuntu 22.04, or Ubuntu 24.04 installed.

Caution

These instructions list steps that can lead to data loss if performed incorrectly. Therefore, always create a backup before resetting the root password.

Requirements
  • The server is switched on.

  • You have created a backup of the server in question.

Load Rescue System

  • 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.

  • Activate the desired server in the Infrastructure > Server area.
  • Click on DVD drive.
  • Activate the Gparted latest_iso DVD.
  • Click on Load DVD.
  • Click on Yes.

The server is restarted and the DVD is loaded. This may take a moment.

Starting the rescue system

  • Click on Action > Open remote console.
  • Select GParted Live (Default Settings) from the menu.
GParted Live startup option (Default Settings) is highlighted in the GParted Live boot menu.
GParted Live startup option (Default Settings) is highlighted in the GParted Live boot menu.
  • Select any policy and confirm it with OK.
Keymap policies in the Configuring console-data window.
Keymap policies in the Configuring console-data window.
  • Select a language. The default is 33 for English.
Available languages ​​in the Loading language settings menu.
Available languages ​​in the Loading language settings menu.
  • Enter 0 for the start method.
Starting method for GParted.
Starting method for GParted.

Change password

  • Close the GParted window by clicking on the black rectangle.
The GParted GUI.
The GParted GUI.
  • Start the Terminal program.
The Terminal program is highlighted on the GParted desktop.
The Terminal program is highlighted on the GParted desktop.
  • To switch to the root user, enter the following command:

    user@debian:$ sudo su

  • Read the hard disc/partition layout with the lsblk command.

    user@debian:$ lsblk

Note

The name of the root file system is required for the next steps. This is usually the largest partition. In this example, vda is the name of the virtual hard disk and vda 1 is the root file system.

  • To mount the root file system, enter the following command and replace the placeholders:

    root@debian:/home/user# mount /PATH/PARTITION /mnt

    Example:

    root@debian:/home/user# mount /dev/vda1 /mnt

  • Check whether loading was successful by executing the lsblk command again. In the example below, the current mount point /mnt is listed in the line vda1.

    root@debian:/home/user# lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    loop0 7:0 0 423M 1 loop /usr/lib/live/mount/rootfs/filesystem.squashfs
    /run/live/rootfs/filesystem.squashfs
    sr0 11:0 1 488M 0 rom /usr/lib/live/mount/medium
    /run/live/medium
    vda 254:0 0 240G 0 disc
    ├─vda1 254:1 0 239.9G 0 part /mnt
    ├─vda14 254:14 0 3M 0 part
    └─vda15 254:15 0 124M 0 part

  • Change to the root file system with the command chroot /mnt.

    root@debian:/home/user# chroot /mnt

Note

If you receive the error message below, you can reset the language to the default C to resolve the issue:

root@debian:/home/user# chroot /mnt
bash: warning: setlocale: LC_All cannot change locale (en_UK.UTF-8): No such file or directory

To do this, enter the following commands:

export LC_ALL=C
export LANG=C

  • To start the password change, enter the following command:

    root@debian:/home/user# passwd root

  • Enter the new password and repeat it.
Note

While you are entering the new password, it will not be displayed for your protection. After you have entered and confirmed your desired character string twice, the password is changed.

Caution

Finally, carry out the following steps before switching back to your regular operating system. Failure to do so may result in data loss.

  • Terminate access to the root file system with the exit command.

    [root@debian:/]# exit

  • To ensure that all changes are correctly applied to the system files, enter the following command:

    user@debian:~$ sync

  • To unmount the root file system, enter the command below. Replace the placeholders.

    umount /PATH/PARTITION

    Example:

    root@debian:/home/user# umount /dev/vda1

  • To check whether the unmount was successful, execute the lsblk command. If your root file system is no longer followed by /mnt, you have successfully unmounted the file system.

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    loop0 7:0 0 423M 1 loop /usr/lib/live/mount/rootfs/filesystem.squashfs
    /run/live/rootfs/filesystem.squashfs
    sr0 11:0 1 488M 0 rom /usr/lib/live/mount/medium
    /run/live/medium
    vda 254:0 0 240G 0 disc
    ├─vda1 254:1 0 239.9G 0 part
    ├─vda14 254:14 0 3M 0 part
    └─vda15 254:15 0 124M 0 part

Eject DVD and restart server

  • Switch back to Cloud Panel.
  • In the Infrastructure > Server area, click on the gparted latest_iso DVD.
  • Click on Yes.
  • Click on Actions > Restart.
  • Click on Yes.

The DVD is ejected and the server is restarted. This may take a moment.