Question

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 !

Was it helpful?

Solution

"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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top