Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Resetting the Root Password on a IONOS VPS or Migrated Cloud Server (Debian and Ubuntu)

Resetting the Root Password on a VPS or Migrated Cloud Server (Debian and Ubuntu)

For Linux VPS and migrated Cloud Servers with Debian 11, Debian 12, Ubuntu 22.04, and Ubuntu 24.04, managed in Cloud Panel.


Introduction

This guide explains how to reset the root password for a VPS or migrated cloud server running Debian or Ubuntu.

Caution: Improper execution of these steps could lead to data loss. Always ensure a backup is created before starting the process.


Prerequisites

  • Server State: Ensure the server is switched on.
  • Backup: A current backup of the server must be created.

Step 1: Load the Rescue System

    • Navigate to the Server & Cloud section.
    • If you have multiple server contracts, select the correct contract.

      Log in to the IONOS Cloud Panel

    • Go to Infrastructure > Server.
    • Click the DVD drive and activate the latest GParted ISO.
    • Click Load DVD and confirm with Yes.

      Activate GParted ISO

  1. Restart and Boot into Rescue System

    • After the server restarts, select Actions > Open remote console.
    • In the boot menu, choose GParted Live (Default Settings).
    • Follow the prompts to:
      • Select a policy and confirm with OK.
      • Choose a language (default: 33 for English).
      • Enter the start method (default: 0).

Step 2: Change the Root Password

  1. Access Terminal

    • Close the GParted window (black rectangle).
    • Open the Terminal program.
  2.  

Switch to Root User

user@debian:$ sudo su
  1. Identify the Root File System

    • Use lsblk to display the disk layout:
      user@debian:$ lsblk
      
    • Identify the largest partition (e.g., /dev/vda1).

    [Insert image: lsblk output with root partition highlighted]

  2. Mount the Root File System

    • Replace /PATH/PARTITION with the root partition:
      root@debian:/home/user# mount /PATH/PARTITION /mnt
      

      Example:

      root@debian:/home/user# mount /dev/vda1 /mnt
      
  3. Change Directory to Root File System

    root@debian:/home/user# chroot /mnt
    
  4. Reset the Password

    • Enter the command:
      root@debian:/home/user# passwd root
      
    • Type and confirm the new password. (Input will not be visible.)

    [Insert image: Successful password reset command]

  5. Sync Changes and Unmount

    • Exit the chroot environment:
      [root@debian:/]# exit
      
    • Sync changes:
      user@debian:~$ sync
      
    • Unmount the root partition:
      root@debian:/home/user# umount /PATH/PARTITION
      

      Example:

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

    [Insert image: Unmount confirmation in terminal]


Step 3: Restart the Server

  1. Eject the DVD

    • Return to the Cloud Panel.
    • In Infrastructure > Server, eject the GParted ISO and confirm with Yes.

    [Insert image: Ejecting DVD process]

  2. Restart the Server

    • Click Actions > Restart and confirm with Yes.

    Note: The server will restart, and the DVD will be ejected automatically.

    [Insert image: Server restart process in Cloud Panel]


By following these steps, you can successfully reset the root password on your VPS or migrated cloud server.

Leave a Reply

Your email address will not be published. Required fields are marked *