LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   Adding shell commands to hosts.deny and hosts.allow (http://www.linuxquestions.org/questions/linux-security-4/adding-shell-commands-to-hosts-deny-and-hosts-allow-129613/)

ridertech 12-28-2003 06: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...

/etc/hosts.deny
ALL : ALL

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 07:22 PM

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

ridertech 12-28-2003 07: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 04: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 04:33 AM.