If you lost your root password in OVH, you should follow these steps.
You set the boot mode first of all in General Info of your server then Boot.
You select rescue mode.
Don’t forget to put an email for the password to be sent there.
Then you reboot your server from the Service Status section.
You will get a password and the reboot will be done.
You run lsblk
root@rescue-customer-eu (ns455565.ip-5-135-152.eu) ~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part
├─sda3 8:3 0 1.8T 0 part
├─sda4 8:4 0 512M 0 part
└─sda5 8:5 0 2M 0 part
root@rescue-customer-eu (ns455565.ip-5-135-152.eu) ~ #
You can see that the main disk is sda3 with 1.8T.
Change accordingly for your case.
You mount it like that
mount /dev/sda3 /mnt
Then chroot that mount point
chroot /mnt
And now you can change your root password or if you’re using ubuntu, then your ubuntu user password
passwd ubuntu
And now you reboot your server and you should be good.
passwd ubuntu