Guide VPS

I locked myself out with my firewall

Locked yourself out with your firewall or a network change? Recovery goes through support. This is how you prevent it next time.

By Hermie Updated

If you've locked yourself out, you can't get back in yourself. Recovery currently goes through support: open a ticket. If you caused it yourself, that's paid work at €30 per quarter hour excl. VAT.

Recovery through support

  1. Open a ticket.
  2. Say which VPS it's about.
  3. Explain what you changed, for example which firewall rule or which network setting.

The more you tell us, the faster support can revert the change.

See also My VPS is unreachable: what can I check myself?

How to prevent it

ufw

Allow SSH first and only then turn on the firewall:

  1. sudo ufw allow OpenSSH
  2. sudo 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.

Did this article help you?

Did not find what you were looking for?

Open a ticket and our team will look into it with you. For a quick question, Discord works too.

Open a ticket Go to Discord