Cherry Servers

How to Reset the Root Password Using Rescue Mode

If you find yourself in the position of having lost access to your server, or you have security concerns, you may need to reset your server’s root password. This guide will give you a detailed overview of how to use Rescue Mode to make essential changes to your system, such as resetting the root password.

#Instructions to Reset Your Root Password Using Rescue Mode

#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.
  3. In the drop-down menu, select the option labeled "Enter rescue mode".
  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.
  5. Press the blue button labeled “Enter rescue mode” to proceed.
  6. Wait for a few minutes while your server reboots 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.

#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, please visit our dedicated SSH guide for Windows and Linux.

#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".
    Command Line
    lsblk
    
    Example output. In this example, "/dev/md127" is the RAID device and the root partition:
    Outputroot@7215:~# lsblk
    NAME    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
    loop0     7:0   0 413.6M  0 loop  /media/root-ro
    loop1     7:1   0  63.9M  1 loop  /snap/core20/2318
    loop2     7:2   0    87M  1 loop  /snap/lxd/29351
    loop3     7:3   0  38.8M  1 loop  /snap/snapd/21759
    sda       8:0   0 232.9G  0 disk
    ├─sda1    8:1   0     1M  0 part
    └─sda2    8:2   0 232.9G  0 part
      └─md127 9:127 0 232.8G  0 raid1
    sdb      8:16   0 232.9G  0 disk
    ├─sdb1   8:17   0     1M  0 part
    └─sdb2   8:18   0 232.9G  0 part
      └─md127 9:127 0 232.8G  0 raid1
    
  2. Mount the root filesystem to a directory, such as “/mnt”.
    Command Line
    mount /dev/sda2 /mnt
    
    If using RAID, the command might look like this:
    Command Line
    mount /dev/md127 /mnt
    

#Step 5: Reset the Root Password

  1. Chroot into the mounted filesystem using:
    Command Line
    chroot /mnt
    
  2. Reset the root password using the “passwd” command.
    Command Line
    passwd root
    
  3. Enter a new password. For security reasons, your input will not be shown, but is being accurately recorded.
    Outputroot@10031:~# sudo chroot /mnt
    root@10031:/# passwd root
    New password:
    Retype new password:
    passwd: password updated successfully
    

#Step 6: Exit and Reboot

  1. Exit the "chroot" environment with:
    Command Line
    exit
    
  2. Unmount the root filesystem using:
    Command Line
    unmount /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.
  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 was completed successfully.

To enable easier access to your server and simultaneously improve security, it is always recommended to add an SSH key. This will prevent unauthorized access and make it easier for you to log in. Please visit our dedicated tutorial to add an SSH key to your server.

No results found for ""
Recent Searches
Navigate
Go
ESC
Exit
We use cookies to ensure seamless user experience for our website. Required cookies - technical, functional and analytical - are set automatically. Please accept the use of targeted cookies to ensure the best marketing experience for your user journey. You may revoke your consent at any time through our Cookie Policy.
build: 920a9a1ae.1622