• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1016
  • Last Modified:

How to know login/logout time (between screen locks) of a Linux user.


I am a manager and would like to know my worker's log-in, log-out time *** BETWEEN HIS SCREEN LOCKS ***.  
This question was not for a first-time log-in session because IT workers (and users) were rarely log off their computer at the end of the day, instead they just used screen-lock.  

In sumary, I would like to know how much time my workers work (during daytime and after hours).  Remember they never log off completely (in Linux, Gnome or KDE environment).

  • 2
1 Solution
Hmmm, I have this session running for about two weeks now.

The first question I would ask is why you are doing this (there is a possible technical solution, but sometimes social solutions are just better).  If people are getting work done, then you shouldn't have major objections to their moving away from the screen at times.
Run "set autologout" or otherwise enable automatic logout on time expiry for console users.

Then simply use the "last" command and diff them.
kblack05 - these are X users, not console.
Screen lock is on the client PC, and therefore there is no central access to information about it.

Only option if this *really* is the approach that you are going for is to change the filename xlock to xlock main, and create a new xlock file, make it executeable, and put in a script that for example:

wget http://www.myserver.com/?clientname

before calling xlock .

You'd need to repeat this for xscreensaver etc.

Another idea is that you could try adding 'nagios' to 'monitor' client PCs:


and then see when the CPU usage drops....then again, some of these screen savers use a huge amount of processing power. Obviously with either of these ideas, you have all the social, privacy and associated legal complications that may arise.


Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now