LinuxQuestions.org
Review your favorite Linux distribution.
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 09-22-2003, 12:06 AM   #1
tarak4u
Member
 
Registered: Feb 2002
Location: ahmedabad, india
Distribution: can't get in
Posts: 61

Rep: Reputation: 15
ftp port blocking


Well i am running a redhat 7.2 linux dhcp server . Which is a cyber cafe server many people use to download warez threw ftp which actully kills my traffic so on the client part i like to disable the ftp port so which configration should i make on server part. it is a masqurade server and firwall is installed
 
Old 09-22-2003, 12:58 AM   #2
jalal
Member
 
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188

Rep: Reputation: 30
you'll need to add a rule in the firewall to drop outgoing connections to ftp ( port 21 ).

something along the lines of:

iptables -t nat -A PREROUTING -p tcp --destination-port 21 -j DROP
 
Old 09-22-2003, 01:20 AM   #3
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Just use the firewall maybe
Block or Drop all traffic on port 21

or go to the file "/etc/hosts.deny"
and add the line:
in.ftpd:ALL

Or you could get fancy:
in.tftpd: ALL: (/some/where/safe_finger -l @%h | /usr/ucb/mail -s %d-%h root) &
 
Old 09-22-2003, 03:49 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
Tarakbhai

you would need to add ip address(es) or a range if you want to restrict only a few boxes. e.g. You wouldn't want to restrict your system from downloading via ftp.

Adding to jalal's post

iptables -t nat -A PREROUTING -p tcp -i <restricted ips> --destination-port 21 -j REJECT

Reject would be a better option for internal clients.

Your clients would still be able to download using HTTP.

An alternative would be to restrict access to the warez sites (but the list can be huge)

Last edited by ppuru; 09-22-2003 at 03:50 AM.
 
Old 09-22-2003, 04:48 AM   #5
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Just turn off your ftp service!

/sbin/chkconfig --list
Now look for ftpd or proftpd then...
/sbin/chkconfig --level 12345 ftpd off
/etc/rc.d/init.d/ftpd stop
 
  


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
apf blocking ftp port 20 freebies Linux - Networking 1 05-08-2005 01:34 PM
Port Blocking adtomar Linux - Networking 6 12-14-2004 03:35 AM
how to circumvent port blocking? zero79 Linux - Networking 1 07-03-2004 07:37 AM
port blocking BwiNfon Linux - Security 4 09-25-2003 10:51 AM
port blocking EyaL Linux - Security 3 10-19-2002 08:58 PM

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

All times are GMT -5. The time now is 07:02 AM.

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