Sign In
Sign In

Root Password Reset

Updated on 26 March 2024

The easiest way to reset your cloud 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.

Reset Password in the Hostman Control Panel

You can always find the root password on the server’s Dashboard:

Image1

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:

  1. Click on the lock icon on the server's page.

Image2

  1. 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:

Image3

Click Change and then confirm resetting the password.

Reset Password via SSH

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.

  1. Connect to the server via SSH as root using the current password.
  2. Execute the command:
passwd
  1. The system will ask for the new password twice. Enter it.

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.

  1. Boot the system from the recovery disk.
  2. In the Console section of the control panel, execute the following commands sequentially:
mount -o rw /dev/vda1 /mnt
chroot /mnt /bin/bash
passwd root
  1. At this stage, the system will ask for the new root password twice. Enter it.

Upon successful password change, you will see a notification.

  1. Press CTRL + D to exit chroot.
  2. Unmount the disk with the command:
umount /mnt
  1. Remount the root file system in read-only mode:
mount -o ro /dev/vda1 /mnt
  1. Reboot the server in standard mode via the control panel.

Now you will be able to connect to the server as root using the new password.

Was this page helpful?
Updated on 26 March 2024

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start
Email us
Hostman's Support