I need to find out if a human is working on a remote linux machine. Either also remotely or locally.
For now, I log into the machine via ssh and get the output of
w | grep -v `whoami`
which tells me which other users have active processes running as well as from where they connected (or if they work locally), which processes they are running and if those are idle.
This is almost 80% of what I want. Unfortunetely, a user which opened two terminals, let one of it idle for 5 days and start a ton of stuff on the other will only show up with the idleing terminal if he just closed the second one before I issued the command.
Is there any way of including information of what users did "just before now" into the output?
Or is this somehow already included in the IDLE part of the
Any other tools I could use?
Update: No need to restrict the solutions to a passive command. I can also manipulate the remote machine, set up logging scripts and force policies onto the users.
Also, as a second problem:
w does not seem to recognise user switches with