1836621 Members
1727 Online
110102 Solutions
New Discussion

IP address of tty

 
SOLVED
Go to solution

IP address of tty

Does anybody know of a way to figure out (or a command) that tells the IP address or DNS name of a tty that is connected remotely by telnet? On TRU64 you could do a "w" command and it would show you the name or address of the connector using that tty. I believe it may have been using reverse-dns to do that.
2 REPLIES 2
Bharat Katkar
Honored Contributor
Solution

Re: IP address of tty

In HPUX it is :

# who -R

This will show sessions alongwith IP address.
Hope this is what you want.

Regards,
You need to know a lot to actually know how little you know
Bill Hassell
Honored Contributor

Re: IP address of tty

For easier (and more reliable) parsing, use:

who -muR

For Xwindows usage:

DISPLAY=$(who -muR | awk '{print $NF}'):0.0

And you'll now have the client's IP/DNS address in Xwindow format.


Bill Hassell, sysadmin