OVH Guide

Change the root password on a VPS (Linux)

This guide explains how to change the root password for a VPS.

  • ovh
  • reset
  • password
  • root
  • ops

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.

To change the VPS root password via rescue mode, you have to:

  • Restart the VPS in Rescue Mode:

In your customer account, select your VPS, switch to Expert mode, then press Restart

  • 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:

[root@rescue ~]# mount /dev/vda1 /mnt

Please 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:

[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.