The easiest way to reset the root user password is through the control panel. This method works even if the old password is lost, as you do not need to enter it.
However, you can also reset the password directly in the operating system, using the guide below.
Note that If you change the password via SSH, the root password you can copy in the control panel will no longer work.
If you know the current password for the root user, you can change it as follows.
root using the current password.passwd
Done, the password is changed. You can now log in as root using the new password.
If you don't know the current root password, you can reset it and set a new one by booting the server from the recovery disk.
root partition. Its name may vary: sda1 or vda1. First, try:mount -o rw /dev/sda1 /mnt
If you receive the error:
mount: /mnt: fsconfig system call failed: /dev/sda1: Can't lookup blockdev.
run:
mount -o rw /dev/vda1 /mnt
Then execute:
chroot /mnt /bin/bash
passwd root
root password twice. Enter it.If the password is changed successfully, you will see a confirmation message, such as: passwd: all authentication tokens updated successfully or password updated successfully.
chroot.umount /mnt
mount -o ro /dev/sda1 /mnt
Now you will be able to connect to the server as root using the new password.