Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 02-21-2004, 09:41 PM   #1
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
How do I deny host?

I want to deny one person from being able to use services one my machine, specifically a web server, based on their ip address. I tried adding them to the hosts.allow file, but that didn't yield any results. Is there any other way I can deny someone from using services on the machine?

Thanks for any help.
Old 02-22-2004, 12:36 AM   #2
Senior Member
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
If you wanted to deny someone, you'd normally use hosts.deny. But not all services use tcpwrappers (hosts allow/deny) and specifically Apache does not. Probably the best way is to just use iptables:

As root do:

iptables -I INPUT -p tcp --dport 80 -s -j DROP

You might have to adjust the destination port (--dport) if you're using a non-standard http port and substitute in the offending IP.


If you want to keep them from accessing anything at all just do:

iptables -I INPUT -s -j DROP

Last edited by Capt_Caveman; 02-22-2004 at 12:38 AM.
Old 02-22-2004, 11:17 AM   #3
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Rep: Reputation: 30
Can't help you, but I love your sig!

Siri Amrit
Old 02-22-2004, 02:00 PM   #4
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Original Poster
Rep: Reputation: 30
Thanks for the iptables help. I was able to deny the person by using directory protection of the webserver's document root.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Deny a host access to all services objorkum Linux - Networking 5 08-17-2007 02:54 PM
How to setup a host.deny and host.allow for SSH? explorer1979 Linux - Security 2 01-31-2005 05:28 PM
Quick quide to host.allow / deny? dtournas Linux - General 2 06-19-2004 06:17 AM
no hostnames in host allow/deny list error with samba colpaarm Linux - Software 1 07-18-2003 10:12 AM
host.deny is very wierd ForumKid Linux - Security 1 12-26-2001 06:09 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration