Re: Obtaining IP address or hostname of client

From: Ed Hew (eah_at_enigma.xenitec.on.ca)
Date: 06/21/05


Date: Tue, 21 Jun 2005 21:20:43 GMT

In article <1119387677.595850.42680@g43g2000cwa.googlegroups.com>,
 <dpsims@virtualdave.com> wrote:
>Hi and thanks to all who have responded.... To clarify:
>
> I am looking for a way to find the address of a 'telnet' client....
>and, yes, 'who -mx' must be my best friend (since I can find no other
>way fo doing this :).... The problem is that I have a number of login
>accounts that automatically execute some program when the person logs
>in.... The programs involved are written in Thoroughbred Basic... If I
>break out of a basic program I can give the 'SYSTEM' command to the
>interpreter and the result is a shell prompt.... however, I do not seem
>to be able to issue the who -mx command as the return is blank.... who
>-x works OK but lists all of the currently logged in users....
>
> I would really like to find some simple system call to obtain the IP
>address of a client or at least get an idea how to write a program to
>provide this info....

This general need annoyed me enough a few years ago to hack away
and find a solution.

        who -mxu|sed '/^.* ............ /s///'|sed '/ .*$/s///'

I run this inline of a larger expression in my client user .profile
inline to set my DISPLAY environment variable - which of course breaks
down when the client is in private address space (NAT). It may however
help you, since it does report where your nameserver says you're
coming from at the publicly-addressible entry point.

It is of course by nature intended to be run within the _client_
login, _not_ on the server the client logs in to. That's easily
do-able too, but not your question as I understand it, ok?

Cheers,
                --ed

--
  Ed Hew <edhew@xenitec.ca>			www.registry.ca
  Canada:  XeniTec Consulting Services;		CA Registry
  Philippines:  GNUPRO Systems, Inc.;		HappyWorks Internet Cafe


Relevant Pages

  • inline code not executing?
    ... Just curious what would cause an .aspx page to not execute its inline ... sent literally to the client, including the tags themselves. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [Xnews] RegEx match for empty From: ?
    ... john sumner is quoted & my replies are inline below: ... client would do it for you. ... You can just keep leaving the old ... signatures in when you reply, but it's rude to do so. ...
    (news.software.readers)
  • Re: Scavenging and DHCP
    ... Read inline please. ... Two hours is way to short, this means your client will have to renew their ... addresses four times in an 8 hour work period. ...
    (microsoft.public.windows.server.dns)
  • Re: HP DOS
    ... The HP Basic program I am trying to run says it needs ... NOT speaking for any employer, client or Internet Service Provider. ...
    (comp.sys.hp.hardware)