Ok, I have personally tried this using this line here in my hosts.deny:
in.telnetd: ALL: spawn(echo "%d %h" | mail -s "Telnet Trap" root@localhost)
And this worked, what a great idea, but, what are some other variables to
this, such as the "%d" or "%h", or where do I find them, I tried finding
them in the man pages but there seemed to be no reference to any kind of
variable like this, such as maybe ident.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Glynn Clements
Sent: Friday, September 11, 1998 5:56 AM
To: Lei Miao
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: tcp wrapper problem
Lei Miao wrote:
> I am using tcpd on the telnet service. I have the following line in the
> hosts.deny file.
>
> in.telnetd: ALL: (echo "%d - %h" | mail -s "Telnet Trap"
> [EMAIL PROTECTED])
>
> I had some problems with it and then I ran "tcpd" and got the following
>
> error: /etc/hosts.deny, line 10: bad option name: "(echo"
>
> This is what I don't understand. According "man 5 hosts_access", it is
said
> that
> the third field can be written as a shell command to be executed if the
> previous two
> fields are matched on an access. (in this case, telnet).
>
> Could someone shed some light on this issue? Is there a version issue
here?
>From the hosts_access(5) manpage:
An extended version of the access control language is
described in the hosts_options(5) document. The extensions
are turned on at program build time by building with
-DPROCESS_OPTIONS.
Most precompiled versions of tcpd are built with -DPROCESS_OPTIONS, so
you have to use the extended syntax described in the hosts_options(5)
manpage. You probably want to precede the shell command with either
`spawn' or `twist'.
--
Glynn Clements <[EMAIL PROTECTED]>