Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting confused by the SSH sessions which are logged in from different places under the same user name. Is it possible to distinguish them somehow? For example, can I configure to annotate the remote IP address in the process table at the ← mark?

root       /usr/sbin/sshd -o PidFile=/var/run/
root         sshd: user [priv] ←
user          sshd: user
root         sshd: user [priv] ←
user          sshd: user@pts/3
user            -bash
user              /bin/ps -AH -o user,cmd
share|improve this question
Could you perhaps give a better example as to why you're needing this? My first reaction was to wonder if you're trying to distinguish between multiple individuals using the same account - which should not be generally allowed. – Iszi Dec 14 '10 at 21:29

You can use netstat -p or ss -p to match connection IP/ports with process ids; netstat shows just the sshd: user [priv] process, ss shows both of them.

share|improve this answer
up vote 0 down vote accepted

w -f shows the remote addresses, but also the tty names. For my situation, this is preferable over netstat/ss because I can match the sessions much more quickly with the process list.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .