Bare Metal & VPS > VPS > How to reset the Cloud VPS access password

04 How to reset the Cloud VPS access password

What the Cloud VPS access password is

The access password, username and IP address are the information you need to access the Cloud VPS you created. While the username (administrator for Windows and root for Linux) and IP address are assigned by the system, you choose the password during the creation process. If you do not remember your password, you cannot access the Cloud VPS.

Who can reset the access password

If you have created a Linux Cloud VPS but do not remember the Cloud VPS access password you chose during the creation process, you can reset it. The procedure varies depending on the template used to configure the Cloud VPS.
If you have forgotten the password for a Windows Cloud VPS, there is no procedure you can perform yourself. You must therefore open a support request.

Before you begin

The operations described may affect the system and data, potentially causing malfunctions or data loss:
  • always back up your data or the entire server externally before performing any operation;
  • if available, create a snapshot of the server from the management panel before making changes to the system;
  • for unmanaged services, you are responsible for managing the operating system and software;
  • if in doubt, consult a trusted system administrator or check the latest official documentation for the operating system or software in use.

Resetting the password for a Cloud VPS with an AlmaLinux template

  • Access the Cloud VPS using the recovery console;
  • use the arrow keys to select the AlmaLinux kernel and press e to edit its boot configuration;
  • locate the line that begins with linux and use the arrow keys to position the cursor between /swap and initrd
     

    rd.lvm=alamlinux/swap initrd

  • enter rd.break enforcing=0
     

    rd.lvm=alamlinux/swap rd.break enforcing=0 initrd

    If rhg quiet appears after /swap, delete it.
  • press Ctrl+X to boot;
  • run the following commands:
     

    mount -o remount,rw /sysroot
    chroot /sysroot
    passwd root

  • enter the new password and press Enter on your keyboard;
  • restart the Cloud VPS;
  • log in using the new password;
  • run the following command:
     

    restorecon /etc/shadow

  • to enable SELinux policies, run the following command:
     

    setenforce 1

Resetting the password for a Cloud VPS with a CentOS template

  • Access the Cloud VPS using the recovery console;
  • use the arrow keys to select the Linux kernel and press e to edit its boot configuration;
  • locate the line that begins with linux, then use the arrow keys to find the code containing ro
     

    ro


      and replace it with rw init=/sysroot/bin/sh
     

    rw init=/sysroot/bin/sh&

  • press Ctrl+X to boot in single-user mode;
  • access the system and run the following commands:
     

    chroot /sysroot
    passwd root
    touch /.autorelabel
    exit
    reboot

Resetting the password for a Cloud VPS with a Debian/Ubuntu template

  • Access the Cloud VPS using the recovery console;
  • in the recovery console window, you will see the Cloud VPS startup process and the GRUB boot message;
  • the message and its duration vary depending on the template:
    • approximately 5 seconds for Debian;
    • approximately 3 seconds for Ubuntu;<
  • before the countdown ends, press e to enter boot editing mode;
  • when the boot file opens, use the arrow keys to move to the operating system kernel loading line (usually beginning with the word linux) and add the following at the end of the line:
     

    init=/bin/sh

  • press Ctrl+X to boot using the modified configuration;
  • the Cloud VPS will restart and, after a few seconds, you will be able to enter commands after the # symbol;
    • enter the following command:
       

      mount -o remount rw /


      and press Enter;
    • enter the following command:
       

      passwd


      and press Enter;
    • enter the new password for the root user and press Enter;
    • confirm the new password and press Enter;
  • the new password for the root user has been successfully configured;
  • to restart the Cloud VPS, enter:
     

    reboot


    or:
     

    init 6

Resetting the password for a Cloud VPS with an openSUSE template

  • Access the Cloud VPS using the recovery console;
  • in the recovery console window, you will see the Cloud VPS startup process and the GRUB boot message, which is displayed for approximately 5 seconds;
  • before the countdown ends, press e to enter boot editing mode;
  • when the boot file opens, use the arrow keys to move to the operating system kernel loading line (usually beginning with the word kernel) and press e again to edit its contents;
  • at the end of the line, add:
     

    init=/bin/bash


    confirm by pressing Enter;
  • when you return to the previous screen, press b to boot in single-user mode;
  • the Cloud VPS will restart and, after a few seconds, you will be able to enter commands after the # symbol;
    • enter the following command:
       

      passwd


      and press Enter;
    • enter the new password for the root user and press Enter;
    • confirm the new password and press Enter;
  • to restart the Cloud VPS, enter:
     

    reboot