LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 09-21-2013, 03:06 PM   #1
onetimeposter
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 https://www.linuxquestions.org/quest...ive-ftp-22127/ 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 http://ubuntuforums.org/showthread.php?t=2116042, 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.
 
  


Reply


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


All times are GMT -5. The time now is 08:48 AM.

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