I am looking for a way to determine the idle time of a local login (mouse / keyboard), remotely via SSH, without root access or access to an already registered Xauthority user.
I know the following solution, which works if you have access to the X server: keyboard detection, mouse activity in Linux
But is it possible without connecting to the X server? Is there another way? For example. indirectly through the use by the processor or memory of certain processes? Any ideas are welcome.
w /dev , , , - , - . /proc/interrupts. "i8042" ( ). , : "grep i8042/proc/interrupts". IRQ 1 () IRQ 12 (, ). , , ( , ), . , - , (IRQ 1) (IRQ 12) / .. ( , ). .
:
1) , - 2) (.. Fopen()/proc/interrupts ()/proc/stat "intr" ) fread() 3) root .
, , , , . , , , , cron ( , ).
, , , . - , , , .
w ls -l /dev/pts - , . linux, ssh xterm.
w
ls -l /dev/pts
, firefox - , , , X root. , , /proc/x _server_pid/* , X , .
Looking for new processes, like another answer, this is the best I can come up with if / dev / pts does not help, and you cannot really look at the input.