Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am in a need of software which can track login and logoff timings on user basis. If possible, software should be cross platform. If you know such software, please share.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

In Linux we have a command for that last tty7 will show you a list of the user using tty7 (where your desktop resides):

Example:

rinzwind tty7         :0           Sat May 28 05:14   still logged in   
rinzwind tty7         :0           Fri May 27 18:22 - down   (04:43)    
rinzwind tty7         :0           Fri May 27 17:11 - down   (00:47)    
rinzwind tty7         :0           Fri May 27 05:44 - down   (01:34)    
rinzwind tty7         :0           Thu May 26 17:59 - down   (03:57)    
rinzwind tty7         :0           Thu May 26 08:03 - down   (00:20)    
rinzwind tty7         :0           Thu May 26 07:27 - down   (00:29)    
rinzwind tty7         :0           Thu May 26 06:41 - down   (00:05)    
rinzwind tty7         :0           Wed May 25 17:17 - down   (06:49)    
rinzwind tty7         :0           Wed May 25 11:33 - down   (00:20)    
rinzwind tty7         :0           Wed May 25 10:28 - down   (00:05) 

The same way you can see who used tty1 or any other ttys (to see who logged into a command line console).

If you want this information you can simple redirect the output to a file:

last tty7 >~/login.txt

and you will find a login.txt in your home directory.

So no need for fancy GUI tools. It is one of the basic instructions an administrator of a systeem needs to check for irregularities (like people trying to access the system that do not need to be on it).

edit.

The output shows: username, tty (7 is the desktop), screen number(not sure), date, -, 'down', time of active session. 'down' means turning the system off and when there is a time it probably means someone else turned it off (reboot issued from tty1) or that the power was turned of without a proper shutdown. The time between () is the time the system was on.

There are more options that might be of interest to you and might also be easier to read:

last reboot

reboot system boot 2.6.38-8-generic Sat May 28 05:14 - 20:47  (15:32)
reboot system boot 2.6.38-8-generic Fri May 27 18:22 - 23:05  (04:43)
reboot system boot 2.6.38-8-generic Fri May 27 17:11 - 17:58  (00:47)
reboot system boot 2.6.38-8-generic Fri May 27 05:44 - 07:19  (01:34)
reboot system boot 2.6.38-8-generic Thu May 26 17:59 - 21:56  (03:57)
reboot system boot 2.6.38-8-generic Thu May 26 08:03 - 08:23  (00:20)

At 5:14 I started this machine and it is now 20:47 and I am currently using it for 15h and 32 minutes. Yesterday I spent 0h47 and 4h43 on my notebook.

The 1st line now shows:

reboot system boot 2.6.38-8-generic Sat May 28 05:14 - 20:54 (15:40)    

last reboot >~/lastreboot.txt to put it to a text file.

share|improve this answer
    
Thanks @Rinzwind How should I interpret the output. xyz tty7 :0 Thu May 5 17:07 - down (01:08) abc tty7 :0 Thu May 5 02:09 - 02:13 (00:03) abc tty7 :0 Wed May 4 22:41 - down (03:27) xyz tty7 :0 Wed May 4 21:59 - 22:33 (00:34) I can see, some of the entries have exact time where as some entries have down written. Which one of them is login or logout time. –  Amey Jah May 28 '11 at 18:33
    
@Amey Jah: not need to thank me! If you like my answer hit the ^ on the left side to upvote the anwser and/or accept the answer. That shows others you found it useful! I'll edit in your question. –  Rinzwind May 28 '11 at 18:36
    
Will do the same. Could you please tell me what is the difference between down and exact time for second last column –  Amey Jah May 28 '11 at 18:40
    
@Ameh Jah added some more info 'last reboot' is probably more to your liking :) –  Rinzwind May 28 '11 at 18:57
add comment

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.