LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2006, 08:34 AM   #1
draget
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Rep: Reputation: 0
ftp server & firewall


Hi

I have a server running Fedora Core 4


It uses the vsftpd server and the builtin fedora core firewall which is set to allow incoming FTP.

When I try to connect to the server long is successful, but on trying to obtain a directory listing, the client declares that there is not route to the host.

I know that the issue is due to how passive mode works, but I would like to be able to use passive mode, and I am wondering if there is any way of doing such short of opening up all ports under 1023.




Any ideas?

Thanks,

Tom
 
Old 04-18-2006, 02:15 AM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
port 20 is for ftp-data

try that opening up that also

I haven't configure a firewall on a ftp server so I have not looked into this aspect

regards
 
Old 04-18-2006, 03:18 AM   #3
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
http://www.sns.ias.edu/~jns/wp/2006/...-it-work/?p=20
 
Old 04-18-2006, 03:21 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
of opening up all ports under 1023
You meant "above" 1024, no?
Passive mode uses a non-privileged port (>1023) and a privileged one (20) instead of using 2 privileged ports (typically 20 and 21) as in active mode.
So, passive mode uses 1 port <1023 and 1 port >1023.

If you look at the pasv_min_port and pasv_max_port configuration parameters for vsftpd, you'll see that you
can limit the port numbers (>1023, used in passive mode) to a certain range.
By doing so, you can then limit your open ports to the same range, instead of having to open all ports > 1023.

ie: select a range of let's say 100 consecutive port numbers. In my example, I'll use 4000 - 4100. You may need to choose different port numbers, if you're already using some of those ports (use nmap to check).
So, pasv_min_port is set to 4000, pasv_max_port to 4100. In your firewall, opening ports 4000-4100 for ftp commands will then suffice.
 
Old 04-18-2006, 05:31 AM   #5
draget
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Tim, thanks, that has cleared it up a great deal


I only intend to have about a max of 5 or so connections at once, should I only open enough ports for my intended usage (ie open 5)?


Thanks,

Tom
 
Old 04-18-2006, 06:47 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Well, you could, but I recommend that you keep open a few more than just 5.
There are other (read: better) ways for you to limit the number of simultaneous connections and load.

The pasv connection port is decided only when the FTP client is already logged in, if I'm not mistaken.
When clients login, they need to give the PASV command to the server before passive mode is considered.
So, limiting the number of PASV ports will not disallow clients to connect to your FTP server, it will just not allow them to use passive mode. Hence, limiting the number of ports may not be such a good idea.
On the other hand, from security perspective, the less open ports you have, the better.

So, in short, it'll probably be a trade-off between security and passive mode performance.
 
Old 04-18-2006, 06:51 AM   #7
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Here's an article I re-read every now and then. http://www.linuxjournal.com/article/7520 I think you're worrying too much about 'ports.' Just set vsftpd up correctly, and then open port 21 for incoming ... and you should be set.

I don't know what Fedora's default firewall manager is these days, but back when I used it, Lokkit sucked. You might try Firestarter or Guarddog, so you have an easy way to see what transactions are being blocked.
 
Old 04-18-2006, 07:43 AM   #8
draget
LQ Newbie
 
Registered: Dec 2005
Posts: 20

Original Poster
Rep: Reputation: 0
Hmmm, I would have to forward all these ports through my router again as well.

Odd, as far as I can remember, last time I did this I simply set checked "ftp" in the firewall exceptions and it worked just fine! It does this time, but only when I set my FTP client to not use passive mode. I think passive would probably be useful being that a few FTP clients out there don't work without it.

Maybe I will just get the couple of people that shall use the server to find FTP clients where one can set it to active!


Thanks,

Tom
 
  


Reply



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
FTP & iptables firewall hct224 Linux - Newbie 9 05-04-2012 01:43 PM
redhat as webserver, ftp server, Mail server, firewall ineth Linux - Newbie 1 09-10-2005 08:14 AM
Passive mode FTP & Firewall Mikessu *BSD 2 07-23-2004 12:12 AM
Fedora's Firewall & FTP Moebius01 Fedora 8 03-30-2004 04:09 AM
Good FTP & Firewall VJD Linux - Networking 3 07-23-2003 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:06 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration