How to Reset VPS Root Password Without Access
![How to Reset VPS Root Password Without Access [Step-by-Step]](https://neuronvm.com/wp-content/uploads/2025/09/Reset-VPS-Password-Without-Root-Access.webp)
Forgetting your VPS password is probably one of the most stressful things that can happen to any server administrator. Imagine one day you want to log in to your server and realize you can’t remember your root password, or worse, your password has been compromised! In such a situation, many people think that all is lost and they need to contact support or even rebuild the server. But the good news is that there are ways to reset vps root password without requiring direct root access. In this tutorial, we will explain these methods step by step and in simple language so that in such cases, you can solve the problem yourself.
4 Steps to Reset VPS Password without Root Access
In this section, we are going to show you the major actions to reset the root password. One of these methods is via rescue mode. So follow the steps below to find out how you can do that:
Step 1- Reboot The VPS in Rescue Mode
First of all, log in to your preferred control panel and reboot the VPS in rescue mode.
Step 2- Identifying The Mount Point
If you noticed before, on older VPS ranges, your partitions will be automatically mounted in rescue mode. To verify this act you can use the following command and identify where your partition is mounted:
df -h
lsblk
But if your VPS is in the current ranges, the MOUNTPOINT column should be empty. In this kind of circumstances, mount the partition first:
mkdir -p /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
Step 3- CHROOT Permissions
The next step you have to do is to edit the root directory to apply the changes to your system. You can do it by using the Chroot command:
chroot /mnt/sdb1/
To list the content stored in the current directory of your system, you can use the following command:
ls -l
Step 4- Changing the Root Password
And in the last part, change your password by using passwd command:
passwd
New password: Retype new password: passwd: password updated successfully
Now if your VPS is in the current ranges, so instead of the default root account, you have initially received login credentials for a user with elevated permissions instead of the default “root” account. Also, the SSH service does not accept login requests as root.
So as a result, it is necessary to enter the username you actually use to log in after passwd command. After passing all these steps, you can log in again by using this username after rebooting, in case root login is not available for you.
Note: When addressing a sensitive topic like recovering a VPS password without root access, it is better to refer to documentation from reputable companies, so if you are interested, you can visit Ubuntu’s main website.
Why is losing the root password a serious issue?
When you forget your root password, it’s not just that you lose access to your VPS; it also has several important consequences:
Service outage: Your site or application may be unavailable for hours or even days.
Security risk: If your password is compromised (not just forgotten), hackers can use that same access to gain further intrusion.
Additional cost and time: You will have to spend a lot of time recovering passwords and checking services, and sometimes you will need to contact hosting support.
Pressure on the technical team: Especially in small businesses, a simple error like losing the root password can affect the entire team.
That’s why learning recovery methods like this guide or using your service provider’s control tools is crucial, not just to fix the problem, but also as a preventative measure.
Why forgetting the root password isn’t just an access problem?
Many users think that losing the root password simply means being unable to log in to the server, when the issue is much deeper, the root password is the master key to managing a VPS, and if it is lost or stolen, you lose complete control of the server, information, and even the security of your customers’ data. Especially with virtual servers, you usually rely solely on the provider’s management tools, which makes it even more important to know how to recover your password. In fact, knowing these steps is not only a troubleshooting skill, but also part of a server security strategy.
Common Errors and Solutions When Resetting a VPS Password
Error when running the chroot command:
If you get an error after running “chroot /mnt/sdb1/”, it is usually because the partition is not mounted correctly or the wrong path was entered. Double-check with “df -h” to make sure the directory is mounted correctly.
New password not saved:
Sometimes a user thinks their password has changed after running the passwd command, but it doesn’t work when they log in again. A common reason is that on some VPSs, the root account is disabled, and the password should be changed for the user provided by the provider (with sudo access), not root.
Forgetting to Reboot to Normal Mode:
After completing all the steps, if you do not return the VPS from Rescue Mode to Normal mode, the server will not boot as before. Be sure to select the Reboot to Normal option in the VPS management panel.
A real-life scenario of the importance of root password recovery
Imagine a small company has online services and uses only a VPS to host the site and database. Now, if the system administrator forgets the root password, he will lose his ability to manage the server; and also, the company’s online store will be out of access to everyone, in these kind of situations, trying to connect to your hosting support might take some time, and every hour of downtime can mean losing customers and their trust, so knowing the steps outlined in this tutorial can be the difference between a few hours of disruption and a serious business crisis.
Preventive tips to avoid forgetting your password
Although password recovery is possible with the above methods, prevention is the best method, some important tips:
1- Always create a second user with sudo access so that you can use it in case of an emergency.
2- You can use a password manager.
3- Try to change your password at least every 3 months
4- If your provider offers two-factor authentication (2FA), be sure to enable it.
Conclusion
Forgetting your root password isn’t the end of the world, because by using methods like Rescue Mode and the administrative commands we’ve reviewed, you can regain control of your server. However, the best solution is always prevention; that is, creating a backup user, using password management, and adhering to security principles. Remember that VPS security is not limited to passwords, but is part of the entire structure of protecting your data and services. So next time you log in, take a few minutes today and have a plan for securely managing your passwords. It will both put your mind at ease and prevent more serious problems.
You will probably need to log in as a user other than root (the main hosting user with sudo access).
Use Password Manager and create a backup user with sudo access.
You might like it