Subject: Re: echo-like replacement for telnetd
To: Andy R <quadreverb@yahoo.com>
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
List: netbsd-help
Date: 09/19/2002 00:35:37
On 2002-09-18 10:04, Andy R <quadreverb@yahoo.com> wrote:
> I had a FreeBSD machine I had to do something similar with, so I
> just tried compiling a C program that was a bunch of printf's,
> changed the line in inetd to point to this program instead of the
> real telnetd, and it works fine. Prints out information, then exits.
> Windows telnet clients don't display it right though, it wraps. Real
> telnet clients work fine.
>
> Maybe someone can tell me if this is secure?

No.  At least, not without seeing the source.

But you went and put yourself into a lot of trouble to reimplement
something that is already there, as a feature.  Try adding the
following to your hosts.allow file:

	telnet : 127.0.0.1 : allow
	telnet : ALL \
		: severity auth.info \
		: twist /bin/echo "You are not welcome to use %d from %h."

The libwrap support of inetd(8) will take care of the rest :-)

- Giorgos