Resetting a lost user password of an OVHcloud server
It can sometimes happen that you lose or forget your user password and now are not able to SSH into your server and neither use the KVM from the OVHcloud control panel.
Eventhough, OVHcloud provides it’s customers with a guide on how to fix the issue, sometimes things just have to be done very quickly and without too much typing. Or maybe you have lost it for multiple servers and need a quick and scalable solution.
This is where this Bash script comes in handy. With just one command you can deploy the script to your server in rescue mode and the script will handle the main partition detection, mount point creation, mounting and the password change.
The only thing you will have to do is to specify the username of your main OS (the account you lost the password for) and re-enter your new password twice.
That’s it!
How to deploy and use it:
Before you can use the Bash script you will have to boot your server in rescue mode first. You can do that in the OVHcloud control panel on your server’s dashboard.
After that you will receive temporary login credentials which you will need for the one line command that will deploy and launch the password change script.
Once you have received the credentials, login to your server and enter this one line command in your terminal:
Command:
wget https://raw.githubusercontent.com/bysecurety/passwdreset/main/passwordreset.sh && chmod +x passwordreset.sh && source passwordreset.sh
Hit enter and let the script do the rest.
If you have any questions or trouble feel free to contact the OVHcloud technical support or refer to the guides down below: