LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 05: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, 06: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, 06: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, 03: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



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

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

All times are GMT -5. The time now is 02:39 PM.

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