FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 18th, 2003, 04:08 PM
dotplus's Avatar
dotplus dotplus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Canada
Posts: 48 dotplus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
iptables block ftp access based on hostname

Hello All,

I have a redhat 7.2 server running several websites on a single ip. I have a small percentage of clients who have ftp access to their sites. I would like to use iptables to drop / reject all ftp requests which are not destined for a specific host name.

I'm using the following command:
(this is a simplified version to drop all ftp except those destined form example.foo.com)

iptables -A INPUT -p tcp --destination-port 21 -d ! example.foo.com -j DROP

the problem is that "example.foo.com" is not the actual host name of the server, rather it is a virtual host name. When the rule is inserted into iptables, "example.foo.com" is changed to the host name of the server

any ideas on how I can keep the destination set to the virtual host name?

Reply With Quote
  #2  
Old June 22nd, 2003, 12:54 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
I don't think you can do this with iptables.

Why not just configure your FTP server not to let the people who don't have FTP access log in?
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
  #3  
Old June 23rd, 2003, 10:36 AM
dotplus's Avatar
dotplus dotplus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Canada
Posts: 48 dotplus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thanks for the reply.

We do have ftp set up so that only registered users can login (anonymous access is disabled). But we have a block of 127 IP addresses, and lately we've been getting a number of spurious ftp attempts (probably scripted, up to 20/second) trying to login as anonymous to each of the ips. It's not caused much of a problem, except that the ftp daemon has to wake up each time to process and reject the login. Since we only have about 6 clients with ftp access I'd like to drop any login attempts not to those addresses. That way, the ftp daemon would only have to respond to about 5% of the spurious connection attempts

I can do it by ip right now, but we're moving to a name-based virtual host system in the near future, and so I'd like a solution which will be portable.

Reply With Quote
  #4  
Old June 24th, 2003, 08:40 AM
swbush swbush is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 6 swbush User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You won't be able to restrict ftp access via the hostname. The ftp server, or indeed the OS won't be able to determine the hostname connected to.

Do your clients have static ips? If so, why not set up ACLs?

Reply With Quote
  #5  
Old June 24th, 2003, 09:07 AM
dotplus's Avatar
dotplus dotplus is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Canada
Posts: 48 dotplus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
We do have static ips (for now), and filtering based on those is not a problem. but we are preparing to move to virtual hosting based on host name.

If its not possible to filter correctly by host name for virtual hosts, then I'll probably, just create a single ip for all the clients to connect to, and just use iptables to deny ftp access to all ips execept that one.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > iptables block ftp access based on hostname


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT