LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-06-2006, 05:07 AM   #1
atanvarno
LQ Newbie
 
Registered: Jul 2006
Posts: 3

Rep: Reputation: 0
hosts.deny - empty client?


Hi,

i try to write a script which gets IPs from a list, and puts them it into my hosts.deny. It already works in a test environment, but every now and then a line with no client is in between. So it looks like: "sshd : "
what happens with this line? Will it be interpreted as not exisiting or will it be interpreted as ALL? Or will it crash?

Thanks

Sascha
 
Old 09-06-2006, 06:18 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Better yet, why don't you include some kind of sanity filter in your script to verify that the IPs are numeric? You could use a standard regex to make sure the IP consists of only numbers.
 
Old 09-07-2006, 02:35 AM   #3
magnus.therning
LQ Newbie
 
Registered: Jul 2006
Location: Gothenburg
Posts: 21

Rep: Reputation: 0
Quote:
Originally Posted by atanvarno
Hi,

i try to write a script which gets IPs from a list, and puts them it into my hosts.deny. It already works in a test environment, but every now and then a line with no client is in between. So it looks like: "sshd : "
what happens with this line? Will it be interpreted as not exisiting or will it be interpreted as ALL? Or will it crash?

Thanks

Sascha
It looks like it's ignored. I agree with Capt_Caveman though, you should filter your entries and not write anything if the list of hosts is empty.
 
Old 09-08-2006, 03:19 AM   #4
filex
Member
 
Registered: Sep 2004
Posts: 56

Rep: Reputation: 15
I would suggest you try http://denyhosts.sourceforge.net/
 
Old 09-08-2006, 04:55 AM   #5
atanvarno
LQ Newbie
 
Registered: Jul 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Hi,

thank you for all your answers. I now filter out the empty lines.
 
  


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
/etc/hosts.deny/hosts.allow have no effect on sshd access bganesh Linux - Security 4 05-04-2006 08:06 PM
/etc/hosts and hosts.deny question ilan1 Linux - Networking 4 03-04-2006 05:28 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
hosts.deny and hosts.allow defaults? gui10 Linux - Security 5 12-20-2001 01:57 AM

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

All times are GMT -5. The time now is 10:50 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
Open Source Consulting | Domain Registration