I have an existing IPtables script running on a LAMP stacked VPS and I need help allowing FTP connections so I can upload and download files to my web server.
I have already installed vsftpd to ubuntu and configured it for authenicated user access but I think my firewall is refusing the connection request.
I have tried modprobe ip_conntrack_ftp to load the module. But I still cant't connect via FTP
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
# You could modify this to only allow certain traffic
# This is in addition to allowing established and related traffic as listed above
-A OUTPUT -j ACCEPT
# Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
#Allows FTP traffic
-A INPUT -p tcp -m tcp --dport 20 -j LOG
-A INPUT -p tcp -m tcp --dport 21 -j LOG
-A OUTPUT -p tcp -m tcp --sport 20 -j LOG
-A OUTPUT -p tcp -m tcp --sport 21 -j LOG
# Allows SSH connections from trusted-host only - drop the rest
-A INPUT -p tcp -m state --state NEW --source 84.70.321.123 --dport 30000 -j ACCEPT
-A INPUT -p tcp --dport 30000 -j DROP
# Create time lock for non-wanted SSH attempts of a period of 1 minute
-A INPUT -p tcp -m state --syn --state NEW --dport 30000 -m limit --limit 1/minute -limit-burst 1 -j ACCEPT
-A INPUT -p tcp -m state --syn --state NEW --dport 30000 -j DROP
# Allow ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
COMMIT
I keep getting connection and I am not sure why.
Please explain this in the most simplest of terms because it seems a little bit complicated and I see many people have similar questions that would benefit from a simple explanation.
ftp localhost? Does is work when you tempoarily disable iptables? Is there anything in the log-filles? – Bart De Vos Aug 25 '11 at 13:23local_enable=YESand alsowrite_enable=YES. Thanks for your other suggestions. I will give them a try as well to see if it makes any difference. Thanks – user866190 Aug 25 '11 at 13:55