From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,83cdeb18bb7ae7f0,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-03-06 00:08:52 PST Path: bga.com!news.sprintlink.net!news.bluesky.net!udel!gatech!psuvax1!news.pop.psu.edu!ra.nrl.navy.mil!leech!harrell From: harrell@leech.nrl.navy.mil (Matthew Harrell) Newsgroups: comp.unix.osf.osf1 Subject: Re: /etc/issue Date: 5 Mar 1995 16:47:48 GMT Organization: Naval Research Laboratory Message-ID: <3jcpvk$nmi@ra.nrl.navy.mil> NNTP-Posting-Host: leech.nrl.navy.mil X-Newsreader: TIN [version 1.2 PL2] : 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 #include #include #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.