-   Linux - Security (
-   -   Adding shell commands to hosts.deny and hosts.allow (

ridertech 12-28-2003 05:47 PM

Adding shell commands to hosts.deny and hosts.allow
I'm running Debian Woody, but I can't seem to find documentation about running shell commands from within hosts.deny (and hosts.allow). Currently, I have the standard deny file...


I want to add logging, but I'm getting errors...

ALL : ALL : (/bin/echo "$(/bin/date) %H TCPW: %d" >> /var/log/secure)
bad option name: "(/bin/echo"

ALL : ALL : spawn(/bin/echo "$(/bin/date) %H TCPW: %d" >> /var/log/secure)
bad option name: "spawn(/bin/echo"

Any help on the syntax? Thanks in advance!

miaviator278 12-28-2003 06:22 PM

man /etc/hosts.allow
man /etc/hosts.deny
man sysklogd

ridertech 12-28-2003 06:41 PM

man hosts.deny and .allow both just display the file in a horrible format.

sysklogd looks promising, but i can't get the most basic shell commands to validate in hosts.deny

I'm checking my files with tcpdchk.

ridertech 12-29-2003 03:52 PM

The following is the correct syntax. I highly recommend denying and logging everything...

ALL : ALL : spawn /bin/echo \
$(/bin/date) \: %h \: %d \
>> /var/log/hosts.deny.log

All times are GMT -5. The time now is 11:25 PM.