This guide presents two scenarios:
- changing the root password. This is when you
- Resetting the root password, when you have lost it
Changing the root password
To change the root password, you must:
- log in as root to the VPS using using SSH.
- Launch passwd command:
[root@vpsxxxxx ~]# passwd
Type the new password (it will not show on screen as you are typing it)
Changing password for root user. New password: Retype new password:
A confirmation message will appear:
passwd: all authentication tokens updated successfully.
To test the new password, just log out and back in again in SSH.
Resetting root password
To change the VPS root password via rescue mode, you have to:
- Restart the VPS in Rescue Mode:
- Log in, in SSH with the Rescue access codes received via email.
On a Cloud VPS, before going any further, you have to mount the partition by launching the following command:
Then, do a chroot on the mount made:
After this you will be able to continue with the password change.
[root@rescue ~]# mount /dev/vda1 /mntPlease note: On a VPS 2014 model, use sda1 instead of vda1.
Then, do a chroot on the mount made:
[root@rescue ~]# chroot /mnt
After this you will be able to continue with the password change.
Launch the passwd command:
Type the new password (it will not show on screen as you are typing)
A confirmation message will appear:
To test the new password, just log out and back in again in SSH.
[root@vpsxxxxx ~]# passwd
Type the new password (it will not show on screen as you are typing)
Changing password for root user. New password: Retype new password:
A confirmation message will appear:
passwd: all authentication tokens updated successfully.
To test the new password, just log out and back in again in SSH.