+ Reply to Thread
Results 1 to 4 of 4

Thread: hosts.allow

  1. #1
    Member Lazywolf's Avatar
    Join Date
    Jun 2004
    Location
    UT
    Posts
    438

    hosts.allow

    I have a Linux (Red Hat) web server. I've noticed some questionable activity in the access_log. I just need to block a few IP addresses (and later on maybe a few IP ranges).

    The tutorials online are pretty straightforward; to block an IP from all services on the server, add the following line to hosts.allow:
    Code:
    ALL : x.x.x.x : deny
    However, when I try to test this with another server with a known IP, I can still successfully connect to my server. I just test by opening a telnet session on port 80 (I know, there's probably better ways, but this should work, right?).

    Another thing I noticed was that I have both a hosts.allow and hosts.deny, but I heard hosts.deny is deprecated (correct me if I'm wrong).

    Is there something I'm doing wrong? Does anyone have better testing methods to try, or better syntax to use?
    My Build (Jan 2011):
    Intel Core i7-950 3.06GHz Quad-Core, 6gb Corsair DDR3 1600, 1TB HDD, 60GB SDD, GeForce GTX 460 1GB

  2. #2
    Goverment property now GroundZero3's Avatar
    Join Date
    Oct 2001
    Location
    NOVA
    Posts
    34,880
    Blog Entries
    59
    Do you have iptables configured and running on the box by chance?

  3. #3
    Member Lazywolf's Avatar
    Join Date
    Jun 2004
    Location
    UT
    Posts
    438
    Looks like I do; I ran the following to make sure it was up and running:
    Code:
    service iptables status
    Then, I found that the following can be run to block all packets from an IP:
    Code:
    iptables -I INPUT -s x.x.x.x -j DROP
    Looks like I'm good to go! Thanks
    My Build (Jan 2011):
    Intel Core i7-950 3.06GHz Quad-Core, 6gb Corsair DDR3 1600, 1TB HDD, 60GB SDD, GeForce GTX 460 1GB

  4. #4
    Goverment property now GroundZero3's Avatar
    Join Date
    Oct 2001
    Location
    NOVA
    Posts
    34,880
    Blog Entries
    59
    Good to hear!

Quick Reply Quick Reply

If you are already a member, please login above.

What is the color of the sky?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Some hosts doesn't work...
    By hubuz in forum Networking and Internet
    Replies: 5
    Last Post: April 9th, 2009, 11:34 AM
  2. Who hosts my website?
    By fourthbean in forum Networking and Internet
    Replies: 2
    Last Post: December 26th, 2005, 01:49 PM
  3. website hosts
    By Klytie in forum Webmastering and Programming
    Replies: 3
    Last Post: August 12th, 2004, 06:16 PM
  4. Need help with hosts.allow
    By hav0c in forum Linux and Unix
    Replies: 1
    Last Post: April 3rd, 2004, 02:20 PM
  5. Looking for hosts, came up with this.
    By Pakaraatzi in forum Webmastering and Programming
    Replies: 11
    Last Post: December 8th, 2002, 05:21 PM

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright 2014 All Enthusiast, Inc