LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 12-28-2003, 06:47 PM   #1
ridertech
Member
 
Registered: Dec 2003
Location: Seattle, Washington
Distribution: Debian 'Sarge'
Posts: 85

Rep: Reputation: 15
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!
 
Old 12-28-2003, 07:22 PM   #2
miaviator278
Member
 
Registered: Dec 2003
Location: Al-Diwania, Iraq (deployed)
Distribution: Slackware ONLY
Posts: 237

Rep: Reputation: 30
man /etc/hosts.allow
man /etc/hosts.deny
man sysklogd
 
Old 12-28-2003, 07:41 PM   #3
ridertech
Member
 
Registered: Dec 2003
Location: Seattle, Washington
Distribution: Debian 'Sarge'
Posts: 85

Original Poster
Rep: Reputation: 15
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.
 
Old 12-29-2003, 04:52 PM   #4
ridertech
Member
 
Registered: Dec 2003
Location: Seattle, Washington
Distribution: Debian 'Sarge'
Posts: 85

Original Poster
Rep: Reputation: 15
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
 
  


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
hosts.allow & hosts.deny question... jonc Linux - Security 9 03-05-2005 10:41 PM
hosts.deny help/how-to jon_k Linux - Software 1 07-25-2003 11:17 PM
hosts.deny and hosts.allow defaults? gui10 Linux - Security 5 12-20-2001 02:57 AM
hosts.allow / hosts.deny fistz Linux - Newbie 1 04-19-2001 08:00 PM
hosts.deny 98steve600 Linux - General 1 01-10-2001 08:39 PM


All times are GMT -5. The time now is 12:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration