Want Telnet client identity in server environment

Want Telnet client identity in server environment

Post by Mark H. Wo » Wed, 24 Jun 1998 04:00:00



Is there some way for a Telnet session to discover where the Telnet client is?
That is, can I do something that would enable me to check for a remote
connection in my .profile, examine the address of the client system, and
conditionally set the value of e.g. PRINTER based on that location?  I
sometimes have to Telnet from (ugh!) Win95 systems and would like to be able to
automagically route my printing to a nearby device.

If I have to e.g. hack login myself, would anyone care to suggest a name for a
remote-host name/address environment variable that either is fairly standard,
or stands a good chance of becoming standard if I argue loud and long enough?
:-)

--

The rats won the first heat, but I'm not*ed yet!

 
 
 

Want Telnet client identity in server environment

Post by Jonathan Luck » Wed, 24 Jun 1998 04:00:00



Quote:>Is there some way for a Telnet session to discover where the Telnet client is?
>That is, can I do something that would enable me to check for a remote
>connection in my .profile, examine the address of the client system, and
>conditionally set the value of e.g. PRINTER based on that location?  I
>sometimes have to Telnet from (ugh!) Win95 systems and would like to be able to
>automagically route my printing to a nearby device.

The utmp file (/var/run/utmp) has an entry called ut_host that
you could match against to find where you are connecting from.

There is an entry for the IP too, but last time I looked it was not
set by anything.

You could also use tcpd (tcpip wrappers) to save the IP somewhere
you login script could find it.  A quick and dirty way is to
create a file named with the pid of the in.telnetd process
serving your connection.  Contents of the file can be the
IP of the the other end.  To use that you have to dig back
though /proc a couple of times to get the pid of your telnetd.
Then use that to read the IP.  Of course this leaves lots
of tiny files around someone has to clean up.

if you use ssh instead of telnet, then sshd will set an
enviroment variable called SSH_CLIENT.  It contains the client
IP, the client port and the host port, seperated by spaces.

-- Jon Luckey

 
 
 

1. Wanted: Fax Server/client for 95 clients w/ Linux server

I'm seeking a fax server package as follows:

        6-10 Win 95 clients

        Linux SAMBA server

        Outgoing only

        Client's get popup asking for destination, time delay,
        etc.

Both Payware and freeware are viable.

I've found several approaches that don't have a popup on the 95
box but still seek that.

--

& no one will talk to a host that's close........[v].(301) 56-LINUX
Unless the host (that isn't close).........................pob 1433
is busy, hung or dead....................................20915-1433

2. telnetd incompatable w/ DG

3. Strange: Telnet client won't quit in a client-server application

4. SVGALIB111 and Linux

5. ``Ansicolor'' telnet client wanted...

6. ksh's fc -e -

7. Server Environment variables list wanted

8. ppp with PAP

9. Wanted: Colorful telnet client/app

10. How to read and write in multiple client-server environment ?

11. Source Code Management in Client/Server Environment

12. RFI: Tools to monitor & admin heterogeneous client-server environment

13. Changing UNIX password in client-server environment