I accidentally blocked my SSH access by modifying iptables on my VPS, which left me locked out. While it wasn't a production server, I managed to reinstall and restore from a backup. This incident made me realize the importance of having a solid recovery plan for critical systems. I couldn't even log in through the provider's console. How do others typically recover access in such situations? Do you rely on the console, or have you set up fallback options like temporary rules, an alternative port, or a VPN?
2 Answers
If the provider console didn't help, that's concerning. Usually, you'd want to know why logging in didn’t work—sometimes it could be a password input issue. But aside from restoring from a backup, try checking if your provider offers a KVM terminal option that’s independent of iptables rules. That could be a lifesaver!
Another option is mounting the OS volume from another server. That way, you can tweak the config files directly since that's all it really is. Just make sure you have physical security measures in place if you're using a data center.

I had a similar issue, but I used the KVM terminal to get back in. Definitely worth checking if it's available.