[comp.sys.hp] putting a message before the LOGIN PROMPT???

khawand@hoss.unl.edu (Nancy Khawand) (01/26/91)

How do I insert a customized message (approx 2 lines) prior to the
login prompt?

Please respond to khawand@hoss.unl.edu.
Thanks for the help!!!

--
Nancy Khawand
University of Nebraska - Lincoln

glen@hpfcmgw.HP.COM (Glen Robinson) (01/29/91)

Nancy Khawand writes:
>How do I insert a customized message (approx 2 lines) prior to the
>login prompt?

Create a file /etc/issue with the information you want displayed.

Glen R

Kimmo.Suominen@lut.fi (Kimmo Suominen) (02/06/91)

>>>>> On 28 Jan 91 16:10:55 GMT, glen@hpfcmgw.HP.COM (Glen Robinson) said:

Glen> Nancy Khawand writes:
>How do I insert a customized message (approx 2 lines) prior to the
>login prompt?

Glen> Create a file /etc/issue with the information you want displayed.

That doesn't do it for the telnet connections.  We have a total of one
(1) terminal connected directly to the mux and through getty - it is
the console ;-)

As far as I know, there's no "/etc/issue" equivalence for incoming
telnet calls.
--
Kim                      /  Internet: Kimmo.Suominen@lut.fi
"That's what I think."  /   Bitnet:   KIM@FINFILES

jmc@cnd.hp.com (Jerry McCollom) (02/06/91)

In article <KIMMO.SUOMINEN.91Feb6145447@kannel.lut.fi> Kimmo.Suominen@lut.fi (Kimmo Suominen) writes:

> Glen> Create a file /etc/issue with the information you want displayed.
> 
> That doesn't do it for the telnet connections.  We have a total of one
> (1) terminal connected directly to the mux and through getty - it is
> the console ;-)
> 
> As far as I know, there's no "/etc/issue" equivalence for incoming
> telnet calls.

The solution I've always recommended is as follows:

	1. Create a script called "/etc/telnetd-banner" (or whatever you
	   want to call it):

		#!/bin/sh
		cat /etc/issue # or whatever banner you want
		exec /etc/telnetd

	   and make it executable.


	2. Change the telnet line in /etc/inetd.conf to:

	       	telnet  stream tcp  nowait  root  /etc/telnetd-banner  telnetd


	3. Reconfigure inetd:

		/etc/inetd -c

You'll get the /etc/issue banner at subsequent telnet logins.

Jerry McCollom
Hewlett Packard, Colorado Networks Division
jmc@cnd.hp.com

garvey@johnny5.uucp (Joe Garvey) (02/08/91)

In article <KIMMO.SUOMINEN.91Feb6145447@kannel.lut.fi>, Kimmo.Suominen@lut.fi (Kimmo Suominen) writes:
> >>>>> On 28 Jan 91 16:10:55 GMT, glen@hpfcmgw.HP.COM (Glen Robinson) said:
> 
> >How do I insert a customized message (approx 2 lines) prior to the
> >login prompt?
> 
> Glen> Create a file /etc/issue with the information you want displayed.
> 
> That doesn't do it for the telnet connections.  We have a total of one
> (1) terminal connected directly to the mux and through getty - it is
> the console ;-)
 
This was discussed once before in this group. I know, I tried the suggestion.

I think the issue was rlogin and not telnet. I don't remember all the details
(not by a long shot). I did try it. It did work, but for one "feature" I
didn't like, that I don't remember.

As I recall, the gist of it was replace the offending program with a script
that cats out the /etc/issue and then starts the desired program.

You might also be able to put it in /etc/inetd.conf. "/usr/bin/cat /etc/issue;
/usr/bin/rlogin". I beleive the full pathnames are required. I no longer run
an HP network... so my names may be wrong.

-- 

Joe Garvey                       uucp: sumax!ole!johnny5!garvey
J5 Research                      registration has been sent in, though we're
Bothell, Wa.                     not in the maps yet.

jmc@cnd.hp.com (Jerry McCollom) (02/20/91)

In article <JMC.91Feb6085400@hpcndnm.cnd.hp.com> jmc@cnd.hp.com (Jerry McCollom) writes:

> The solution I've always recommended is as follows:
> 
> 	1. Create a script called "/etc/telnetd-banner" (or whatever you
> 	   want to call it):
> 
> 		#!/bin/sh
> 		cat /etc/issue # or whatever banner you want
> 		exec /etc/telnetd
> 
> 	   and make it executable.
> 
> 
> 	2. Change the telnet line in /etc/inetd.conf to:
> 
> 	       	telnet  stream tcp  nowait  root  /etc/telnetd-banner  telnetd
> 
> 
> 	3. Reconfigure inetd:
> 
> 		/etc/inetd -c
> 
> You'll get the /etc/issue banner at subsequent telnet logins.

I was asked if the same could be done for rlogind.  It is ugly, though
possible, with one modification to the banner script (call it
/etc/rlogind-banner):

	#!/bin/sh
	echo "\000" # fool rlogin (actually, rcmd(3))
	cat /etc/issue # or whatever you want
	exec /etc/rlogind $*

Do the other stuff for rlogind (change inetd.conf, reconfigure inetd)
and you're set.

In the script, you need to echo the null to fool the rlogin client into
thinking the connection setup went ok.  The "ugly" part comes about when
you notice some excess whitespace emitted after the banner -- I haven't
investigated why that happens.  The other ugliness might arise if there
are errors during connection setup (at the rcmd(3) level, not at the
rlogin protocol level).  Otherwise, in both the hosts.equiv
authenticated and non-authenticated cases, this seems to work fine.

Jerry McCollom 
Hewlett Packard, Colorado Networks Division
jmc@cnd.hp.com

("it ain't supported, but it works and it sure beats editing the binary")