Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 was wondering if there was a way to detect which users had an active ssh session, or rather how long they have been logged in.


share|improve this question

migrated from Jun 15 '11 at 1:52

This question came from our site for professional and enthusiast programmers.

Out of curiosity, why do you want to track the time used? – Nick ODell Jun 14 '11 at 4:19
up vote 2 down vote accepted

use w and last.

share|improve this answer

Each ssh session has a corresponding tty process. Just check how long it has been running.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.