Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 09-21-2013, 03:06 PM   #1
LQ Newbie
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
Final solution in reference to thread "IPTABLES rules for active FTP"

Just wanted to reply on some years old thread on which is still up to date.
Would be great if a moderator could add following information to the end of the above thread, because i just saw that it got already closed:

The true Linux spirit did it and still does it =)
This topic is pretty current, since i also arrived on, which is a thread from early 2013.

Since nowadays ip_conntrack_ftp is already loaded on most machines, the helper module was the hint i needed: Doing iptables for a while now, but the first time i am hearing about helper modules. Me loves Linux more now

Just to round the thread up, here are the final rules needed for punching a little hole in our ftp-client machine towards a ftp-server:

#ftp on 21:
iptables -A OUTPUT -o eth0 -p tcp -s $ownip -d $remoteip --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -d $ownip -s $remoteip -p tcp --sport 21 -m state --state ESTABLISHED -j ACCEPT
#ftp data for 21:
iptables -A OUTPUT -o eth0 -p tcp -s $ownip -d $remoteip -m helper --helper ftp-21 -j ACCEPT
iptables -A INPUT -i eth0 -d $ownip -s $remoteip -p tcp -m helper --helper ftp-21 -j ACCEPT

Whereupon $ownip is a local ipadress at your machine on eth0, and $remoteip is the servers ip address.
I explicitly used ftp-21, because that you can modify the helper to also use non standart ftp port.

Most important reason to let a thread open: People in 10 years also just want solutions for the same problems.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTABLES rules for active FTP TruckStuff Linux - Security 7 04-22-2009 06:21 PM
Point me in the direction of a good active ftp "how to" guide for linux rhel5 daggs Linux - Newbie 6 03-11-2009 03:37 PM
iptables not working for "accept" action rules vijfita Linux - Networking 7 05-13-2005 05:28 AM
Comments request for "O'Reilly's Linux iptables Pocket Reference" carboncopy General 3 03-03-2005 09:24 PM
Are there "const correctness" rules for Java with final? johnMG Programming 1 07-11-2004 10:58 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration