SUMMARY : Login message for psuedo tty's (from telnet)

From: Jim Murff (
Date: Thu Apr 22 1993 - 03:21:20 CDT


        I have a working solution now. Thanks again to sun gurus. the original
Question was ::

>Hopefully this is a easy question: I have followed Answerbook and Man pages
>as far as they go. I am trying to setup psuedo ttys so that they have a login
>message. Since getty doesn't run on psuedo ttys I am trying to figure where to
>do this. Telnet starts the login process but is there anywhere to set up
> login message for a "network" device? I have one special machine that needs to
>let people know before they try and logon that they are at a special machine.
>I am running 4.1.2 and 4.1.3. Any ideas if it is possible and how?

I got several answers to this. I was hoping for something more "standard" that
would be easy to put in and then forget. I suspected it wasn't going to happen.
(I actually plan for the day I might not be working on the systems.) Anyway
the solutions all ran along the same line which is a shell script.
( I am trying to figure where to put it and how to make it obvious that it
exists and IS NOT required. The planning thing again.) Anyway I got a few
examples that I will pass a long verbatim. These are all variations on the
same theme and one might suit you better than another. I am using H Morrow
Long's version of the truth :).

I got two replies about MOTD but that just isn't what I was trying to do.
I also got on reply suggesting embedding termcap type commands right into
the ttytab. This sound like a kettle of fish I want to avoid but it is worth

>From Jim Davis ( ::
The telnet banner message is set in the telnetd sources, so one way
would be to get the telnet daemon source and hack on it. A simpler
approach is to write a wrapper that goes around the telnet daemon,
something like this:

exec /path/to/real/telnet-daemon

and put your wrapper in /etc/inetd.conf where in.telnetd is currently.

(I can't remember whether cat will suffice above, or whether you need
to use awk or such to generate \r\n at the end of a line instead of
simply \n.)

>From H Morrow Long long-morrow@CS.YALE.EDU
My inetd.conf file entry for telnetd :

# telnet stream tcp nowait root /usr/etc/in.telnetd in.telnetd
telnet stream tcp nowait root /local/etc/ in.telnetd

The script /local/etc/ (note that on for some machines -such
as Macs running NCSA Telnet - and some terminals - depending on how they
handle a single linefeed - you may want to insert real carriage returns (^M)
into the end of the line string to echo to the remote system):
# $Header$
# Warning banner for Sparky telnet sessions.
# $Log$

echo ' ' >&2
echo 'You break in and mess with my workstation I rip off your face,' >&2
echo 'break all your teeth, hit your kneecaps with a tire iron. Got it?' >&2
echo ' ' >&2

exec /usr/etc/in.telnetd $*

# shouldn't get here
exit 1

>From (System Administrator)
I did this a manor that is slightly kludgy, but it works well.

move the /usr/etc/in.telnetd to some file (I used /usr/etc/
Create a new /usr/etc/in.telnetd that echos some message (or cats /etc/motd)
For example, we use:

echo ""
echo "This machine is a part of the Computer Systems Development Centre"
echo "Equipment belonging to CSDC may only be used by CSDC employees"
echo "for valid R&D work only."
echo ""
exec /usr/etc/ $*

When users try to telnet in they get the following:

csdc_1> telnet csdc_1
Trying ...
Connected to csdc_1.
Escape character is '^]'.

This machine is a part of the Computer Systems Development Centre
Equipment belonging to CSDC may only be used by CSDC employees
for valid R&D work only.

SunOS UNIX (csdc_1)


Many thanks to ::

-Jim Murff

Jim Murff ( Voice # (619)622-8878
IRT Corp, San Diego, CA. Corp # (619)450-4343
System Software Engineer/System Admin. Fax # (619)622-8888

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:45 CDT