I issued the following command not thinking through all of the implications:
iptables -I INPUT -m tcp -p tcp --dport 22 -j DROP
I was immediately dropped from the server - I thought my connection would remain as when you start and stop sshd. My question is - is port 22 permanently dropped? Is there anyway around this? If I powercycle the server will sshd on port 22 still be blocked? Basically - I am looking for a way to login.
As background I issued the command in an attempt to do all of the following:
iptables -I INPUT -m tcp -p tcp --dport 22 -m state --state NEW -m limit --limit 3/min --limit-burst 3 -j ACCEPT
iptables -I INPUT -m tcp -p tcp -s 22.214.171.124 --dport 22 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 22 -m state --state ESTABLISHED,RELATED -j ACCEPT
to eliminate an ssh attack that was happening.