Last updated
Have you forgotten the password for your dedicated Linux server? There's nothing wrong with that, let's solve this problem.
First of all, we need to put our dedicated server into recovery mode (Rescue). This can be done by contacting technical support or using the control panel, if there is such a technical possibility.
We use the lsblk
command to view the existing drives on our server.
If you are using Software RAID on your server, the output will be something like this. Pay attention to the md sections, namely md0, md1, md2:
If Software RAID is not used on your server, then depending on the types of drives, the output of the command will look something like this:
Next, you need to mount the partition of the main disk. Since Software RAID is used on our test server, md2 is suitable in this case.
Great!
Now we specify a new root directory to work on the newly mounted drive:
The main process is completed. Now all we have to do is use the standard command to change the password of the corresponding user.
We enter the new password twice.
Done.
It simply remains to restart the server in the cloud panel or with the reboot
command to exit Rescue mode. After that, we can connect to our server using the new specified password.
If you get a similar error when using the reboot
command, then you need to use the CTRL + D
keyboard shortcut to exit the additional created session.
Great. Now we can restart our server and start further work!