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.

Thanks!

link|improve this question
Out of curiosity, why do you want to track the time used? – Nick ODell Jun 14 '11 at 4:19
feedback

migrated from stackoverflow.com Jun 15 '11 at 1:52

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

2 Answers

up vote 2 down vote accepted

use w and last.

link|improve this answer
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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