Resetting the Root password using “Rescue Mode”

This Guide will provide a detailed step-by-step process for resetting the root password if you have lost access to your server or it requires the reset.

This Guide will provide a detailed step-by-step process for resetting the root password using the “Rescue Mode” tool. 

Key Points to Consider: 

  • This guide is specifically designed for Cherry Servers bare metal servers.
  • "Rescue Mode" allows you to boot into a minimal environment, giving you the flexibility to make essential changes to your system, including resetting the root password.

Step-by-Step Instructions 

Step 1: Access the Cherry Servers client portal 

  1. Log in to your Cherry Servers account using your credentials. 
  2. Navigate to the server you need to access. 

Step 2: Activate “Rescue Mode” 

  1. Select the server on which you would like to reset your root password. 
  2. Press the "Actions" button in the top right corner of your client portal (see Fig. 1).

    Fig. 1. Clicking the "Actions" button in the Cherry Servers client portal. 
  3. In the drop-down menu, select the option labeled "Enter rescue mode" (see Fig. 2).

    Fig. 2. Select the "Enter Rescue Mode" option from the drop-down menu.
  4. A pop-up window will appear, asking you to generate a temporary password. This password allows you to access your server while it’s booted into the rescue environment (see Fig. 3). 

    Fig. 3. Creating a temporary password for ”Rescue Mode” access. 
  5. Press the blue button labeled “Enter rescue mode” to proceed.
  6. Wait for a few minutes while your server reboots into “Rescue Mode” (see Fig. 4).

    Fig. 4. Waiting a few minutes while the server boots into "Rescue mode".
  7. When your server is successfully booted into “Rescue Mode”, you will see a notification in blue text indicating that your server is up and running in the live environment (see Fig. 5). 

    Fig. 5. Server already booted in "Rescue mode” 

Step 3: Connect to Your Server 

  1. Use an SSH client to connect to your server. The IP address will be displayed in the Cherry Servers client portal.
  2. The username is "root" and the password will be the one you generated previously. For security reasons, this password is not displayed again, so ensure you have it noted down. 
  3. If you are having trouble using SSH, refer to these tutorials for your operating system: 

Step 4: Mount the Root Filesystem 

  1. Identify the root filesystem partition. Usually, it will be something like “/dev/sda1” or “/dev/nvme0n1p1”. If you are using a RAID configuration, it may look like “/dev/md127” or “/dev/md1” (see Fig. 6).
    $ lsblk
    Example output:

    Fig. 6. "lsblk" output showing disk and partition details.

    In this example, ”/dev/md127" is the RAID device, and it is the root partition. 
  2. Mount the root filesystem to a directory, such as “/mnt”.
    $ mount /dev/sda2 /mnt
    If using RAID, the command might look like this:
    $ mount /dev/md127 /mnt

Step 5: Reset the Root Password 

  1. Chroot into the mounted filesystem.
    $ chroot /mnt
  2. Reset the root password using the “passwd” command (see Fig. 7).
    $ passwd root

    Fig. 7. Utilizing the “chroot” command to access the filesystem and resetting the password with the “passwd root” command. 

Step 6: Exit and Reboot 

  1. Exit the "chroot" environment.
    $ exit
  2. Unmount the root filesystem.
    $ umount /mnt
  3. Access the Cherry Servers client portal again. 
  4. Select your server from the list. 
  5. Press the "Actions" button in the top right corner of the client portal. 
  6. Click on "Exit rescue mode" from the drop-down menu (see Fig. 8). 

    Fig. 8. Select the "Exit rescue mode" option from the drop-down menu. 
  7. Wait for a few minutes while your server reboots into its normal operating mode. 

Step 7: Verify the New Root Password 

  1. After the server reboots, login with the new root password to ensure the reset is successful. 

Summary 

By following these steps, you can successfully reset the root password on your Cherry Servers Bare Metal server using “Rescue Mode”. This process ensures you regain access to your server while keeping it secure and functional. 

To increase security and easier access to your server, it is always recommended to add an SSH key. This will prevent unauthorized access and make it easier for you to log in. You can follow this tutorial to add an SSH key to your server