After buying a VPS, you may have forgotten your password. This tutorial is about to explain how to reset VPS password without root access. There is a time when you may forget your root password and you need to access your system. It is a bad situation but don’t worry cause we will show you the way to solve this problem. However, it is important to know how to reset your VPS password in case you forget it or it gets compromised. In this tutorial, we will guide you through the process of resetting your VPS password without root access, using different methods depending on the server management interface you have access to.
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:
First of all, log in to your preferred control panel and reboot the VPS in rescue mode.
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
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
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.
As the final words, reboot your VPS in “normal” mode in your control panel.
If you use the Ubuntu operating system, we suggest you read the article How To Change The Default Password On Ubuntu Linux.
In this tutorial, we have provided a guide on how to reset a VPS password without root access. By following the steps outlined in this tutorial, you can easily reset your VPS password using the management interface provided by your hosting provider. It is important to always keep your VPS password secure and regularly change it to ensure the security of your server.
How useful was this post?
Click on a star to rate it!
Average rating 5 / 5. Vote count: 2
No votes so far! Be the first to rate this post.
In this article, we are going to teach you How to Add an Additional IP on a Dedicated Server. It is ...
KVM (Kernel-based Virtual Machine) is an open-source virtualization platform that allows you to run ...
What is your opinion about this Blog?