skip to content
Ruban Selvarajah

Unblock incoming SSH connections to an Ubuntu server

/ 1 min read

Not that common with key-based authentications being the norm but it does happen from time to time when working with test servers.

Let’s 🚀

Check if your IP is banned

1. Access the root terminal

  • If you’re using GCE, you can use Cloud Shell
  • For other providers, there’s usually a way to access the root terminal through the dashboard

2. Print the firewall rules

Terminal window
sudo iptables -n -L

You should see something like this:

Chain f2b-sshd (1 references)
target prot opt source destination
REJECT all -- reject-with icmp-port-unreachable

where is the banned IP

Unban the IP

Terminal window
sudo fail2ban-client unban

You should now be able to connect using your local terminal again.