Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

migrated from stackoverflow.com 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

2 Answers 2

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

 
discard

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.