Iptables blocking SSH access

Posted December 9, 2014 2.6k views

I’m on Ubuntu 14.04, and somewhere along the line of trying to change my SSH port from 1365 to 22, I locked myself out of accessing the computer via SSH. I can SSH into port 22 from the localhost, so I’m guessing the problem is with iptables (yes, I did update the config for the new port). I’m using fail2ban to prevent SSH brute forcing. The VPS also runs OpenVPN AS. Here’s a screenshot of my iptables INPUT chain.. If anyone could help point me in the right direction of what might be the problem, I would be grateful.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

You can access your server using the built in console access on your VPN page. The console access simulates the physical connection of a keyboard/monitor - so you can’t lock yourself out of that.

  • Yes, I know. That’s how I took the screenshot. For multiple reasons, I need actual SSH. One of which is that the built in console is pretty terrible in my experience.