Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used this command

iptables -A INPUT -p tcp --dport 22 -j DROP

because i was trying to stop port 22 outgoing since i was getting a warnings from amazon and now i cant ssh in....what do i do

share|improve this question
up vote 7 down vote accepted

SSH runs on port 22. You've just told your firewall to stop all incoming SSH traffic. (I.E your connection).

If you didnt save this anywhere then iptables will not have this rule on reboot. Unless you have physical access or a console you will probably need to restart

share|improve this answer
If a clean shutdown is initiated, and depending on the distribution settings, the iptables rules may be automatically saved on shutdown/reboot. – slubman May 6 '11 at 4:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.