Cpanel/WHM FAQs

Home | Webstats | Frontpage | Disk Quota | FTP Problems | MySql | Exim Notes | Basic Commands | TCP Wrappers | Kernel Compilation| Nagios| Harddisk Restoration| Cpanel Scripts| IPTables
Search Query

RSS site feed|Webmaster Stuff|International Calling Cards|Linux Recovery|Server Recovery|Hard Drive Recovery|Raid Recovery

TCP WRAPPERS

When a user tries to connect to your computer, the connection is made up of a pair of data: an ip address and a port. Inetd reacts to this connection by looking up the port number in /etc/services, and then looking in the file /etc/inetd.conf for a corresponding service, and then runs the service. With tcp wrappers, inetd is tricked into running tcpd instead of the service that would normally be called. Tcpd checks it's rules in the /etc/hosts.allow and /etc/hosts.deny files. It either accepts the connection and runs the service or denies the connection based on it's rules.


TCP wrappers only works for services that ined starts. Sendmail, apache, and named do not use inetd, and so they are not protected via tcp wrappers. Check to see if tcp wrappers is installed ::view the /etc/inetd.conf file. If it is not installed, a typical line looks like this:

ftp stream tcp nowait root /usr/sbin/ftpd ftpd -l -a
and if it is installed, it looks like this:
ftp stream tcp nowait root /usr/sbin/tcpd ftpd -l -a

The bolded part shows the difference. Assuming it is installed, you must edit your /etc/host.allow and /etc/host.deny files to give tcpd the rules it needs


Edit your /etc/hosts.allow and /etc/hosts.deny to limit access to your computer's network services.

SYNTAX >> service: hostname : options

# allow connections
ALL: ALL: ALLOW

# allow connections from my local network
ALL: ALL@127.0.0.1 : ALLOW

# alow all connections from computers on my network
ALL: ALL@192.168.124.1 : ALLOW

ALL: ALL@192.168.124.10 : ALLOW

# allow connections from a particular domain
in.ftpd: domainname : ALLOW


A similar thing can be done with the host.deny file by putting:

#deny all services from any host not allowed by hosts.allow
ALL: ALL: DENY

#deny all ftp services from any host not allowed by hosts.allow
in.ftpd: ALL : DENY


Please send comments on these web pages to sumith at sumith.net

copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Sumith Sreedhar
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.


Valid HTML 4.01!