Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: harrell@leech.nrl.navy.mil (Matthew Harrell)
Subject: Re: /etc/issue
Date: 5 Mar 1995 16:47:48 GMT	[thread overview]
Message-ID: <3jcpvk$nmi@ra.nrl.navy.mil> (raw)

: On OSF/1, at least for the console, this is an issue of getty :-)
: See gettydefs(4) for the definition of the login prompt on the console.

: If you log in via rsh or rlogin, you don't get a login banner at all.
: (just "login:" and "Password:" - if the client is not in the .rhosts
: mechanism)

: That is, your quoted line above is hard wired in telnetd.
: I haven't looked into it further.  Maybe you can manipulate /etc/gettydefs
: to force telnetd to give another banner.  Note that telnetd does seem to
: NOT call getty but instead interprete gettydefs itself.
: See getty(8), login(1) etc.


If you want to display a file during a telnet login, the following file
can help:



#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define ISSUE           "/etc/issue"

#ifdef __linux__
#  define TELNETD       "/usr/sbin/in.telnetd"
#elif defined (OSF1)
#  define TELNETD       "/usr/sbin/in.telnetd"
#endif

void main ( int argc, char **argv )
{
  FILE *Input;                          /* Issue file */
  char Buff;                            /* Character buffer */

  if ( (FILE *) NULL == ( Input = fopen ( ISSUE, "r" ) ) ) {
    fprintf ( stderr, "%s:  Unable to open %s\n", argv [0], ISSUE );
    exit ( 1 );
  }

  while ( fread ( &Buff, sizeof ( char ), 1, Input ) ) {
    if ( Buff != 0x0a )
      putchar ( Buff );

    else {
      putchar ( Buff );
      putchar ( 0x0d );
    }
  }

  fclose ( Input );

  if ( !fork () )
    execv ( TELNETD, argv );

  exit ( 0 );
}



Just change the definition of ISSUE to whatever you want to display,
compile, and change /etc/inetd.conf to reflect the new program to
use.  For example, I typically stick this program in /usr/sbin/tcpd-telnet
and then change the telnet line in /etc/inetd.conf to 

telnet  stream  tcp     nowait  root	/usr/sbin/tcpd-telnet   telnetd

This way, tcpd-telnet gets run first, outputs the issue message, then execs
telnetd.

--
        /-------------------\              Phonenet address:
       /  Matthew Harrell      \             202.767.4085
      /   Naval Research Lab     \ 
      /   Code 7640                \       Internet address:
       \  Washington, DC   ___==== /         harrell@uap.nrl.navy.mil
        |--------------------\               
        |====================/             Friends don't let friends do DOS.


             reply	other threads:[~1995-03-05 16:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-05 16:47 Matthew Harrell [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-02-20 22:01 /etc/issue AFSAR
1995-02-21  9:02 ` /etc/issue Michael Sternberg
1995-02-22 14:11 ` /etc/issue Todd S. Aven
1995-02-22 15:27   ` /etc/issue Wuxu Peng
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox