0

3 ppl (A B C) are connected to a local server (S1) through SSH (putty, or Unix console), with the same username (foobar). Is there a way to associate their own IP to the pts they create ?

For example, a command witch display that :

S1:/root# ls -l /dev/pts
crw------- 1 foobar   tty  136, 0 16 apr 10:34 0 <-> 192.168.0.A
crw------- 1 foobar   tty  136, 2 16 apr 10:22 2 <-> 192.168.0.B
crw------- 1 foobar   tty  136, 3 16 apr 09:26 3 <-> 192.168.0.A
crw------- 1 foobar   tty  136, 5 16 apr 09:26 5 <-> 192.168.0.C

Thanks !

4wk_
  • 2,458
  • 3
  • 34
  • 46

1 Answers1

1

"who" command shows you the association between pts-s and hostnames (or ip-s if there is no hostname). You can change the hostnames to IP using 'host' command (if this is a requirement for you).

vladmihaisima
  • 2,119
  • 16
  • 20
  • 1
    I think also "finger" command provides the information you were looking for, but in the short format might not show the full host name (but I think it does in the long format "finger -l") – vladmihaisima Apr 16 '12 at 10:25
  • Well, I didn't know finger, and yes, `finger -l` seems to give me informations I need too ! ;) Thx – 4wk_ Apr 19 '12 at 15:27