I have a VPS with a hosting company so I remotely access it via SSH.
I'm trying to flush all the iptables rules and start from scratch… The problem is that when I type # iptables INPUT DROP (as I wan't to block all incoming and whitelist) then PuTTY drops out and I can't connect.
How can I do this without being booted out by CentOS when I type that command.
Or is there another way to do it.
Thanks
Best Answer
You need to make sure that your existing connections stay open when you add that rule.
Then add your allow list below this, and finally add a drop line to the END of the INPUT chain
A good read/tutorial for you to start with would be: here