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've seen a few examples online... but what rules do you guys use in live environments to control your FTP usage? Basic usage, nothing special, but I hear I need to be able to support active ftp sessions.

share|improve this question
up vote 2 down vote accepted

Here's a basic setup:

iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Also need to tell iptables to load the kernel module that tracks FTP connections in /etc/sysconfig/iptables-config:

share|improve this answer
where would I add the IPTABLES_MODULES part ? To my rules file? – Webnet Oct 14 '10 at 20:47
No, it goes in /etc/sysconfig/iptables-config file – kernelpanic Oct 15 '10 at 14:10
I don't have an iptables-config file anywhere. I'm running ubuntu – Webnet Oct 18 '10 at 2:07

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.