Reset Root Password for Cloud Server/Virtual Cloud Server (Ubuntu)

For Cloud Servers and Virtual Server Clouds with Ubuntu Server 18.04 LTS

Can't find/remember the root password of your Cloud Server or Virtual Server Cloud? We will show you how you can still access it and assign a new password.

Please Note

If you did not set your own password when you created the Cloud Server and did not subsequently change the automatically assigned initial password, you can display the initial password in the Cloud Panel.

Starting the KVM Console

To reset your password:

  • Log in to IONOS and click Server & Cloud under My Products. If necessary, select the contract you want to use.

  • Select the desired Cloud Server in the Infrastructure > Servers section.

  • To start the KVM Console, click Actions > Start KVM Console, and the KVM Console will open in a new tab.

Starting Recovery Mode

  • Switch to the Cloud Panel.

  • Make sure that the desired server is selected. Then, click on Actions > Restart.

  • Select the Hardware method and click Yes.

  • Immediately switch to the tab where the KVM console is open and hold down the Shift key. The Gnu Grub2 start menu will open.

Notes
  • When entering the recovery mode, the Shift key must be pressed immediately after the restart. If you see the VMware logo, you have missed the point where you can access the GRUB menu

  • With some servers, it may be necessary to press the Esc key instead of the Shift key.

Resetting the Password

  • Use the arrow keys to select Ubuntu.

  • Press the E key to edit the boot options.

  • Add the following option at the end of the line beginning with linux /vmlinuz: init=/bin/bash
    Example:
    linux vmlinuz-4.15.0-99-generic root=/dev/mapper/vg00-lv01 ro apparmor=0 init=/bin/bash

Please Note

This entry may vary depending on your configuration.

  • Press F10 to continue the boot process and the server will boot into a root shell without a password prompt.

  • Once the shell is ready, the first thing you need to do is mount the system partition with write access. To do this, type the following command:
    mount -o remount,rw /

  • Now you can change the password with the command passwd:
    passwd
    Enter new UNIX password:
    Retype new UNIX password:
    passwd: password updated successfully

  • Finally, you need to restart the server. Enter the following command: reboot -f

  • Select the Ubuntu option and press Enter.

Your server will now boot back into the normal system. You can then log in with the new password.