For Cloud Server and Virtual Private Server packages
In this article, we'll show you how to reset the root password of your Linux Cloud Server or Virtual Private Server using Knoppix.
You have logged into the Cloud Panel.
The server is powered on.
You are in the Infrastructure > Servers section.
You have created a snapshot of the server.
When you hover the mouse cursor over the icon, the program name Terminator is displayed.
The /bin/bash window opens.
To switch to the root user without a password prompt, enter the following command:
Create the directory where the volume group should be mounted.
:~# mkdir /mnt/old
To determine the volume group to mount, type the following command:
:~# vgsThe volume group is displayed.
run/lvm/lvmetad.socket: connect failed: No such file or directory
WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
VG #PV #LV #SN Attr VSize VFree
vg00 1 2 0 wz--n- 79.52g 0
In the above example, the name of the volume group is vg00. This name may vary depending on the Linux version.
To activate the volume group, enter the vgchange -ay command in the following form:
:~# vgchange -ay NAMEOFTHEVOLUMES
:~# vgchange -ay vg00
To query information about the existing Logical Volumes, enter the following command:
Normally, two Volume Groups are displayed. Compare the VSize value that was displayed to you after you entered the vgs command with the LV Size value. The LV Size value is displayed after you enter the lvdisplay command for each existing Logical Volume. Make a note of the path of the Logical Volume whose size approximately matches the VSize value. This path is displayed under the LV Path item.
To mount the detected volume, type the following command:
:~# mount LV Path /mnt/old
:~# mount /dev/vg00/lv01 /mnt/old
To reset the root password for the Linux operating system installed on the server, you must change the root directory by entering the following command:
:~# chroot /mnt/old
To change the root password, enter the following command:
To exit the chroot environment, type the following command:
To unmount the drives, enter the following command: