[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] Telnet and scripts



skhader@xxxxxxxxxx forced the electrons to say:
> Hi there,
> Well  I guess that might help !!
> And regarding /etc/profile, I want the shell script to be executed when the
> client gets connected ( like /etc/issue ) and not after the client logins !

Hi,

First, /etc/issue doesn't get executed - it gets cat(1)'ed. But I
understand what you mean. So, I tried the following script on my machine
and it worked:

cat /home/binand/bin/fingerd.sh

#! /bin/sh
echo "You have reached Binand's machine!"
exec /usr/sbin/in.fingerd

Of course I had to replace the fingerd line in /etc/inetd.conf with:

finger stream tcp nowait root /usr/sbin/tcpd /home/binand/bin/fingerd.sh

The same should work with telnetd as well.

Binand

-- 
#include <stdio.h>                                   | Binand Raj S.
char *p = "#include <stdio.h>%cchar *p = %c%s%c;     | This is a self-
int main(){printf(p,10,34,p,34,10);return 0;}%c";    | printing program.
int main(){printf(p,10,34,p,34,10);return 0;}        | Try it!!
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.