SUMMARY : Finding IP address on other end of a session.

From: Michael Kline (
Date: Wed Jun 22 1994 - 13:17:39 CDT

As always, there's an easier way of doing things.

Thanks to :

Dan Stromberg - OAC-DCS <> (Eric Wampner ORL)
Jerry de Raad <>
Bryan Solie <>

The easisest method is to retrieve the hostname from the output of the
'who am i' command. After doing this, I simply arp the name to get the
IP address.

Suggestions were made to use the utmpx database and retrieve info via
getutxent(), but the trouble of making this work lost out to the ease and
quickness of the above solution.

Mike Kline

My original question:

> I'm sure somebody is already doing this:
> We have a login that goes directly into an Expect script (its shell) which
> acts as a gateway for our users to connect to other services. We are now
> adding services that require us to limit their use to different machines at
> different times. What I need is an easy way to find out the IP address of the
> machine the users are logging in from. The method I am using now is tracing
> back open files for the port being used to determine which in.telnet session
> is being used and then tracing the open files on that session to find the
> peer address. This takes a long time! Does anyone know of a quicker way to
> find this information?
> Mike
> --
> Michael R. Kline
> Library Systems Division 512-495-4391
> University of Texas General Libraries
> ~~~
> If I can't play poker, what's the point?

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:04 CDT