Skip to content
🧮 Is Lifetime with ZapX Pass worth it? Work it out for your own servers in 30 seconds. Open the Lifetime calculator →

VPS (Linux): Restore Access

Find out how to regain access to your Linux VPS after a password lockout and minimize downtime

27 November 20262 min read43 Views0 helpful

Introduction

It can happen quickly. You try to log in to your Linux server, but your password is no longer accepted or you’ve forgotten it. This means you can’t access the system, important data, or services. That can be frustrating, especially when the server is needed for ongoing operations. You can usually restore access without reinstalling the system by using Rescue Mode in your ZapX dashboard. Just follow the steps below to regain access to your server and get back to work with minimal disruption.

Start Rescue Mode

In the Rescue tab of your VPS management page, open the Rescue Mode card and click Start Rescue Mode. The server will restart once from a rescue environment (usually SystemRescue) instead of booting from your own disk.

Once the status changes to Active, click Switch to Console (or open the Console tab directly) to connect to the rescue environment.

Restore access

First, find out the name of your partition in the rescue environment:

bash
lsblk

Mount the partition where your system is installed with write permissions (the device name depends on your server, e.g. /dev/sda1 or /dev/vda1):

bash
mount /dev/sdaX /mnt

Use chroot to switch to your installed system so that the following commands run in the context of your actual installation:

bash
chroot /mnt

If you don’t know the username, you can list all available user accounts by checking the home directories:

Code
ls /home

To reset the password, use the passwd command followed by the username:

Code
passwd username

Replace username with the actual account name. Enter the new password and confirm it when prompted. Your password won’t be displayed on the screen as you type.

Then exit the chroot environment and unmount the partition:

bash
exit
umount /mnt

Exit Rescue Mode

Go back to the Rescue tab and click Exit Rescue Mode. The server will then restart normally from your own disk.

Conclusion

After completing these steps, you should have successfully set a new password for the user you selected. You can now log in again as usual via SSH. If you have any further questions or need help, our support team is here for you every day! 🙂

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

Use Rescue Mode in your ZapX dashboard: go to the Rescue tab and select Start Rescue Mode. The server will boot once from a rescue environment (SystemRescue) instead of from its own disk.
Mount the partition containing your system (e.g. 'mount /dev/sdaX /mnt'), switch to it with 'chroot /mnt', and reset the password with 'passwd username'.
List the available user accounts by checking the home directories: 'ls /home'.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.