If we want to change the password of the administrative account for the Linux server, we can change it using the rescue mode.
First, shut down the server (1) and boot it into an rescue mode (2).
Then go to the server console and mount the main system partition /
:
mount /dev/vdXY /mnt
for LVM:
mount /dev/mapper/X-Y /mnt
X-Y
is the name of the device / partition.
The next step is to execute the command:
chroot /mnt /bin/bash
Once the chroot
command is executed correctly, you will get access to the system console.
If the chroot
command ended with an error, verify that the specified partition is a system partition.
Having access to the system console, we can change the password of the administrative user with the passwd
command.
After changing the password, unmount all mounted partitions using the command:
umount -a
Then exit the rescue mode and restart the server. After restarting the server, we can log in to the account of the administrative user to whom we have just changed the password.
Contact our Customer Support.