One of the most common reasons for losing access to a server is a misconfigured network setting or a firewall rule that accidentally blocks your own IP. The Linux rescue system lets you bypass this, access your configuration files directly, and fix the problem.
Prerequisite: This guide must be performed from within the Linux rescue system. If you have not started rescue mode yet, see the guide on starting rescue mode first.
After booting into rescue mode and connecting via SSH, you must mount your server's main partition to make its files accessible. First, identify your main partition:
Look for your main partition — typically /dev/sda3, or /dev/md2 for a software RAID setup. Then mount it:
Replace /dev/sda3 with your actual partition name. Your server's entire filesystem is now accessible under /mnt.
Navigate to the relevant configuration file and edit it. The location depends on what needs to be fixed and which Linux distribution you are running.
If you were locked out by an iptables rule, edit the rules file directly. The location varies by distribution:
Find the rule that is blocking your access — it will be a DROP or REJECT rule. Either delete the line entirely or comment it out by adding a # at the beginning.
If you made an error in a network interface configuration file — such as a wrong IP address, netmask, or gateway — edit the corresponding file:
Correct any mistakes, save the file, and proceed to the next step.
Once you have corrected and saved the configuration file, the fix is complete. Do not reboot from within the rescue environment.
exit to close the SSH sessionAlways cancel rescue mode via the PowerPanel — never reboot directly from within the rescue environment or VNC session.
Back to the Linux rescue overview for more guides on what you can do in rescue mode.