LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices



Reply
 
Search this Thread
Old 02-21-2004, 10:41 PM   #1
Inexactitude
Member
 
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, 01:36 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
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 xxx.xxx.xxx.xxx -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.

----EDIT---

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

iptables -I INPUT -s xxx.xxx.xxx.xxx -j DROP

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

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

Siri Amrit
 
Old 02-22-2004, 03:00 PM   #4
Inexactitude
Member
 
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.
 
  


Reply


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


All times are GMT -5. The time now is 10:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration