Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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:

IPTABLES_MODULES="ip_conntrack_ftp"
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
add comment

Your Answer

 
discard

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.