LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   hosts.deny - empty client? (https://www.linuxquestions.org/questions/linux-security-4/hosts-deny-empty-client-480868/)

atanvarno 09-06-2006 05:07 AM

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

Capt_Caveman 09-06-2006 06:18 AM

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.

magnus.therning 09-07-2006 02:35 AM

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.

filex 09-08-2006 03:19 AM

I would suggest you try http://denyhosts.sourceforge.net/

atanvarno 09-08-2006 04:55 AM

Hi,

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


All times are GMT -5. The time now is 08:09 PM.