LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 10-07-2011, 06:37 PM   #1
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
Basic hosts.deny Q


rhel 5.7 fully updated,
i havent tried this yet, searched LQ but nothing specific.

can i EXCEPT the wildcard keyword ALL

ALL: ALL EXCEPT RFC1918, RFC1918, RFC1918

this would make my life easy since i am trying out denyhosts service. my hosts.allow would be empty. i would like to do it this way to outright deny anything that is not internal IP, then allow denyhosts to write (stack) deny entries for any brute forcing of ssh that might happen from internal IP. and yes, i know about iptables.

Last edited by Linux_Kidd; 10-07-2011 at 07:17 PM.
 
Old 10-07-2011, 08:27 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
The purpose of hosts.allow is to add exceptions to what is specified in hosts.deny. http://its.virginia.edu/unixsys/sec/hosts.html
For techniques for handling brute force attacks on ssh, read the sticky post in this forum. http://www.linuxquestions.org/questi...tempts-340366/
 
Old 10-07-2011, 09:02 PM   #3
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by allend View Post
The purpose of hosts.allow is to add exceptions to what is specified in hosts.deny. http://its.virginia.edu/unixsys/sec/hosts.html
For techniques for handling brute force attacks on ssh, read the sticky post in this forum. http://www.linuxquestions.org/questi...tempts-340366/
if i place rfc's in hosts.allow then denyhosts adding entries to hosts.deny would be completely useless. using a combo of sshd config, pam config, and the use of denyhosts gets me the layers and functionality i want w/o extra stuff.

anyone know the answer to my question about the syntax?
 
Old 10-07-2011, 10:27 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
Perhaps this will help. http://linux.about.com/od/commands/l...l5_hostsde.htm
 
Old 10-07-2011, 10:43 PM   #5
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by allend View Post
nope, doesnt help. i know what all the texts say. it doesnt explain if EXCEPT will apply to the match all "ALL" wildcard keyword. all the man pages give examples of `list_1 EXCEPT list_2', is "ALL" wildcard considered a list?
 
Old 10-07-2011, 11:07 PM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
Did you get down to the EXAMPLES section?
Quote:
MOSTLY OPEN
Here, access is granted by default; only explicitly specified hosts are refused service.

The default policy (access granted) makes the allow file redundant so that it can be omitted. The explicitly non-authorized hosts are listed in the deny file. For example:

/etc/hosts.deny: ALL: some.host.name, .some.domain
ALL EXCEPT in.fingerd: other.host.name, .other.domain

The first rule denies some hosts and domains all services; the second rule still permits finger requests from other hosts and domains.
 
Old 10-08-2011, 07:25 AM   #7
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by allend View Post
Did you get down to the EXAMPLES section?
thnx. yes, that example does shows an "ALL EXCEPT" but its on the service side. i will assume the parsing rules carry over to the client_list section (no reason to think it doesnt). i cannot find and example matching mine so i'll just give it a try next week. thnx.

update:
ALL: ALL EXCEPT works as expected.

with a combo of tcpd, pam, and denyhosts i have a flexible configuration that contains access/auth controls at different levels.

Last edited by Linux_Kidd; 10-11-2011 at 03:47 PM. Reason: tested my setup
 
  


Reply



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
can't restrict sshd access through hosts.allow and hosts.deny but was working earlier farhan Linux - Security 4 04-18-2008 07:41 AM
Feisty: hosts.allow hosts.deny not present Thane Ubuntu 1 07-08-2007 01:16 PM
/etc/hosts.deny/hosts.allow have no effect on sshd access bganesh Linux - Security 4 05-04-2006 08:06 PM
hosts.allow & hosts.deny question... jonc Linux - Security 9 03-05-2005 09:41 PM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:23 PM.

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
Open Source Consulting | Domain Registration