> i can't get this piece of code to work. it's supposed to
> email root whenever non-authorized connections are detected.
> /etc/hosts.deny:
> ----------------
> 
> ALL: ALL: /usr/sbin/safe_finger -l @%h | /bin/mail -s %d-%h root & 

I have the following in my /etc/deny, which  mails root when someone attaches to a 
port they aren't allowed to, and outputs a message if wished. It also appendsa copy of 
the  mail to /var/log/in.deny
 
 ALL:ALL: banners /etc/msgs: spawn (/bin/echo `date` "%d[%p] %u@%h (%a)" >> 
/var/log/in.deny): spawn (/bin/echo `date` | /bin/mail -s "%d[%p]%u@%h(%a)" root) &:
 DENY

 You'll also have to create an /etc/msgs directory, in which files with the same name 
as the service (e.g. in.telnetd, in.ftpd etc), contains some text like :

You have unwittingly tried to connect to a system that doesn't want you. GO AWAY

For ftp, you'll need :
401 You have unwittingly tried to connect to a system that doesn't want you. GO
AWAY

root gets mails like :
.
.
.
Subject: in.telnetd[2696][EMAIL PROTECTED](130.250.1.47)

Mon Mar 16 20:41:33 GMT 1998

Hope this helps :)

Simon Delicata
-- 
Your lucky number is 3552664958674928.  Watch for it everywhere.
________________________________________________________________________________
Simon Delicata          __   _
[EMAIL PROTECTED]   / /  (_)__  __ ____  __    Brunel University Student
BCS Member            / /__/ / _ \/ // /\ \/ /    
                     /____/_/_//_/\_,_/ /_/\_\ .. The choice of a GNU Generation
________________________________________________________________________________


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to