I locked myself out with my firewall
Locked out by your firewall or a network change? Log in through the console in the client area and open up SSH again yourself.
By Hermie Updated
Can't reach your VPS over SSH anymore because your firewall or a network setting is blocking the connection? You can fix that yourself through the console in the client area. The console works as if you're sitting in front of your server's screen, so it also works when SSH is blocked.
What you need
- Your username:
debian,ubuntu,almalinuxorrocky, depending on your operating system. It's also shown on the VPS card in the client area. - The password of that user. You received it by email after the installation.
- Your VPS must be running.
Recover through the console
- Log in to the client area and go to Services.
- Open your VPS and click Console.
- Wait until the connection is established. If you see a black screen, click inside the console and press Enter; the login prompt will appear.
- Log in with your username and password.
- Open up SSH again with the command for your firewall (see below). The command starts with
sudo, after which the server asks for your password once more. - Click Back and log in over SSH again.
ufw
Allow SSH again:
sudo ufw allow 22/tcp
If you use a different SSH port, replace 22 with that port. If you first just want to get back in, turn ufw off completely and then set it up again at your own pace:
sudo ufw disable
firewalld
sudo firewall-cmd --add-service=ssh --permanent && sudo firewall-cmd --reload
iptables or nftables
If you created the rules yourself with iptables or nftables, remove the rule that blocks SSH or add a rule that allows port 22. For example with iptables:
sudo iptables -I INPUT -p tcp --dport 22 -j ACCEPT
A wrong network setting
If you changed the network settings, restore your old settings in the console and apply them again. Once your network works again, you can log in over SSH again too.
Lost your password as well?
Without a password you can't log in to the console. You then have two options:
- Reinstall through the client area. You get a clean VPS with new login details.
- Open a ticket. Mention which VPS it's about and what you changed, for example which firewall rule or network setting. If you caused it yourself, that's paid work at €30 per quarter hour excl. VAT.
Reinstalling wipes your VPS
When you reinstall, all files on your VPS are lost. If you have data you want to keep, choose a ticket.
How to prevent it
ufw
Allow SSH first and only then turn on the firewall:
sudo ufw allow OpenSSHsudo ufw enable
If you use a different SSH port, allow that port instead, for example sudo ufw allow 2222/tcp.
Network settings with netplan
Use sudo netplan try instead of sudo netplan apply. With netplan try your changes are rolled back automatically if you don't confirm them within a short time. So if you lose your connection, it comes back by itself.
Windows
Always keep Remote Desktop (RDP) allowed in Windows Firewall. If you block RDP, you can no longer reach your VPS.
Keep a second session open
When you change the firewall or SSH settings, keep your current session open. Test in a second window whether you can still log in. If you can't, you can still revert it in the first session.
See also
- How do I log into my VPS?
- My VPS is unreachable: what can I check myself?
- I can't log in to my VPS (Permission denied)
Still stuck? Open a ticket and mention your server name.
Did this article help you?
Related articles
Can I install Windows on my VPS?
Yes: you choose Windows Server 2025 yourself when you order or reinstall your VPS, from the X4 package. This is how the licence works and how you log in.
How do I upgrade my VPS resources?
Learn how to add more RAM, CPU or storage to your VPS when you need more power.
How do I install an operating system on my VPS myself with netboot.xyz?
How to boot your VPS with netboot.xyz and install an operating system yourself via the console, with manual network settings.
How do I reinstall my VPS?
How to reinstall your VPS yourself in the client area: choose an operating system, confirm with your hostname and log in with the new password.