The easiest way to reset your server's root password is through your Hostman control panel. However, you can also change the password directly in the server's settings when connected via SSH. Note that in this case the root password you can copy in the control panel will no longer work.
Below we describe both methods of resetting the root password.
You can always find the root password on the server’s Dashboard:
However, if you have changed the password manually in the operating system, the password in the control panel won’t work.
To reset the root password:
Click on the lock icon on the server's page.
In the popup window click Change password to confirm password reset.
The new password will be immediately available on the Dashboard.
You can also reset the password in the Access tab:
Click Change and then confirm resetting the password.
If you change the password using this method, 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 the root password is unknown, you can reset it and set a new one by booting the server from the recovery disk.
mount -o rw /dev/vda1 /mnt
chroot /mnt /bin/bash
passwd root
root
password twice. Enter it.Upon successful password change, you will see a notification.
chroot
.umount /mnt
mount -o ro /dev/vda1 /mnt
Now you will be able to connect to the server as root
using the new password.