Computing.Net > Forums > Linux > hosts.deny and hosts.allow

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

hosts.deny and hosts.allow

Reply to Message Icon

Name: vinod gaur
Date: June 16, 2002 at 03:38:29 Pacific
Comment:

sir,

i want to stop some local user ip address through hosts.deny and hosts.allow for httpd port 80 they can not use. i am using linux 6.1 redhat. can i do it or not if yes then how. because i have give some type of entry but i am not sucess. pl help me out

with greate regards

vinod guar



Sponsored Link
Ads by Google

Response Number 1
Name: Jon
Date: June 16, 2002 at 11:31:37 Pacific
Reply:

Hi, I have setup this in Solaris before, but never tried in Linux yet, I think they are more or less the same...

First you have to know that host.allow OVERRIDE hosts.deny, so you should deny all in hosts.deny then enable valid client in hosts.allow.

e.g. only allow telnet from 192.168.1.10:

- hosts.deny:
-
in.telnetd:ALL:banners /etc/banners/deny
-

-hosts.allow:
-
in.telnetd:LOCAL, 192.168.1.10:banners /etc/banners/allow
-

/etc/banners/deny and /etc/banners/allow is the massage shown to user in both case

Hope this help..
Jon


0

Response Number 2
Name: brett
Date: June 16, 2002 at 18:17:32 Pacific
Reply:

From memory

In the hosts.allow file put
192.168.0.1:httpd # this allow this ip to connect to port 80
192.168.0.1:httpd

in hosts.deny put ALL:ALL

How it works is, when a connection is made if first check the host.allow file for a entry, if the entry is not there it goes to the hosts.deny and check if there a entry there.

Id suggest you use IP tables or IPChains to do this rather than the hosts files, as this does not black all ports, only ports the use inet services


0

Response Number 3
Name: brett
Date: June 16, 2002 at 18:18:52 Pacific
Reply:

Its httpd: not the otherway as i stated in previous post


0

Response Number 4
Name: junky_toof
Date: June 17, 2002 at 02:12:49 Pacific
Reply:

Again, most http daemons are not wrapped by
tcpwrappers which usually runs from inetd.
It is not impossible to use it in this
manner, but it is unnecessary.
All servers, apache,roxen,thtppd, come with
their own access list implementations.
In addition a simple packet filtering rule:

ipchains -A input -s localaddy -d webserver
-p tcp --dport 80 -j DENY -l

will do the trick with less overhead and
give you a log of access attempts.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


setup my mail server Partioning Windows XP for...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: hosts.deny and hosts.allow

Sendmail and hosts.allow www.computing.net/answers/linux/sendmail-and-hostsallow/17558.html

Allowing Ports 23 and 22 www.computing.net/answers/linux/allowing-ports-23-and-22-/10691.html

install smaba swat and have a problm ??? www.computing.net/answers/linux/install-smaba-swat-and-have-a-problm-/7973.html