You can easily accomplish it by using an output of
w
it shows you the IDLE time you can use it in conjuction with awk to strip out the IDLE time similar to this
w | awk '{print $1 " " $5}'
it will output the table
USER IDLE
bob 7:43m
You can use it in a perl script to format the output to suite your needs, and then you can use the obtained info to filter through ps and find out which processes are running by the particular user - kill user's processes, send him/her a text message with echo, etc.
as for the second question I'd suggest you to use ssh - a secure alternative to telnet (telnet sends all sensetive info in clear text and the password can be sniffed very easily; ssh, on the other hand, uses encription to send the data over the wire).
|