[comp.sys.hp] telnet and getty questions

rdg@hpfcmgw.HP.COM (Rob Gardner) (02/07/90)

>2) I'd like to get getty to print the /etc/issue message to ptys when someone 
>     attemps to telnet (and rlogin if possible) to our machines.

/etc/getty doesn't run when you telnet or rlogin to a remoe machine, so
you really should be saying "I'd like to get rlogind/telnetd to print..."
But you can't do that, either, without hacking the source.

Rob

rocky@hpfcmgw.HP.COM (Rocky Craig) (02/07/90)

>> 2) I'd like getty to print the /etc/issue message to ptys when someone 
>>    attemps to telnet (and rlogin if possible) to our machines.

> /etc/getty doesn't run when you telnet or rlogin to a remoe machine, so
> you really should be saying "I'd like to get rlogind/telnetd to print..."
> But you can't do that, either, without hacking the source.

Well, how about trying this:

1. Write the following shell script and call it "/etc/rlogind.issue":

	/bin/cat /etc/message
	exec /etc/rlogind

2. Change /etc/inetd.conf to invoke /etc/rlogind.issue when the rlogin
   port is hit.  inetd connects stdin and stdout of the invoked process
   to the socket, so the "cat" should work.

There are three unknowns in this solution:

a. Will inetd invoke a shell script?   Methinks it does.
b. Look at the posting time on this response.  Which implies...
c. I may have dreamed this entire conversation :-)

Rocky Craig			
Hewlett-Packard Workstation Group, Marketing Event Technical Support
rocky%hpfcmr@hplabs.hp.com

This article does not represent the official position of the Hewlett-Packard 
Company.  The above data is provided for informational purposes only.  It is 
supplied without warranty of any kind.

barbour@boulder.Colorado.EDU (BARBOUR JIM) (02/08/90)

In article <1080124@hpfcmgw.HP.COM> rocky@hpfcmgw.HP.COM (Rocky Craig) writes:

>>> 2) I'd like getty to print the /etc/issue message to ptys when someone 
>>>    attemps to telnet (and rlogin if possible) to our machines.
 
>> /etc/getty doesn't run when you telnet or rlogin to a remoe machine, so
>> you really should be saying "I'd like to get rlogind/telnetd to print..."
>> But you can't do that, either, without hacking the source.
 
>Well, how about trying this:
>
>1. Write the following shell script and call it "/etc/rlogind.issue":
>
>	/bin/cat /etc/message
>	exec /etc/rlogind
>
>2. Change /etc/inetd.conf to invoke /etc/rlogind.issue when the rlogin
>   port is hit.  inetd connects stdin and stdout of the invoked process
>   to the socket, so the "cat" should work.
>
>There are three unknowns in this solution:
>
>a. Will inetd invoke a shell script?   Methinks it does.
>b. Look at the posting time on this response.  Which implies...
>c. I may have dreamed this entire conversation :-)

Hmm, I created a script called /usr/local/etc/rlogind.issue :

	#! /bin/sh
	if [ -r /etc/issue ]
	then
		/bin/cat /etc/issue
	fi
	exec /etc/rlogind $@

I then modified the inetd.conf file with the line:

rlogin	stream	tcp	nowait	/usr/local/etc/rlogind.issue	rlogind

and then did % inetd -c

Then, rlogin <my-host-name>

the /etc/issue message gets printed and then I get my prompt back (i.e. the
exec doesn't happen).

I did exactly the same thing with the telnetd and the /etc/issue message 
gets printed and the login prompt appears.

Any ideas?

Jim

rocky@hpfcmgw.HP.COM (Rocky Craig) (02/09/90)

> Then, rlogin <my-host-name>
> the /etc/issue message gets printed and then I get my prompt back (i.e. the
> exec doesn't happen).

> I did exactly the same thing with the telnetd and the /etc/issue message 
> gets printed and the login prompt appears.

> Any ideas?

Yeah, don't listen to yahoos who come up with quick fixes at 4:30 a.m. :-)

I tried it, got your results, THEN read the man page /o\.  Look in the 
"Diagnostic" section.  Both rlogin/rlogind and telnet/telnetd appear
to hold a "connection established" dialogue before running login(1M).
Apparently the rlogin/telnet running locally is interpreting the
contents of /etc/issue as a "connection failed" message and terminating.

You probably don't want to replace your login(1M) with a front end...
I guess if you REALLY wanted this, you could write your own socket-based
front end that fired up a....Nahhhhhhhh.

Sorry about the bad advice, but it sounded good the other morning :-)

Rocky "No advice in this note, so no disclaimer needed" Craig