Operating System - Linux
1752806 Members
6221 Online
108789 Solutions
New Discussion юеВ

Re: RH Linux Logon user history

 
SOLVED
Go to solution
Gary L
Super Advisor

RH Linux Logon user history

Hi there

My manager gave me a task: create a daily report of all logon/logoff user list and send to him. The requirements let me list in whole day, all users who once logon and logoff the system, list their time and terminals.

As we know, the command ' who or who -u ' only list at that time, the current system users. If someone already log out, it doesnтАЩt be listed at that time. It is Not a whole day information.

Would you please kindly tell me how to do it. Any answers will be very appreciated. If someone already have corresponding script, that's good for reference.
7 REPLIES 7
Gary L
Super Advisor

Re: RH Linux Logon user history

In other words:
I wanna list all the users who once logon the system in one day. Include, time and terminal informations.
Who could help me?
James R. Ferguson
Acclaimed Contributor
Solution

Re: RH Linux Logon user history

Hi Gary:

Have a look at the 'last' command. See your friendly manpages for details.

Regards!

...JRF...
Gary L
Super Advisor

Re: RH Linux Logon user history

Hi James

Thank you very much for your fast reply. I will check " last " soon.
Ivan Ferreira
Honored Contributor

Re: RH Linux Logon user history

You should also check the "ac" command, please see man "ac", for example "ac -p".
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Gary L
Super Advisor

Re: RH Linux Logon user history

Hi Ivan

Thank you very much for your "ac -p" suggestion.
I think, "last -a " pretty match my requirements. It include: username, tty, logon time, logout time and from which terminal etc more informations.
So, I have been writting the script base on the command last -a.
But anyway, thanks again for your kindly help

-Gary
Ivan Ferreira
Honored Contributor

Re: RH Linux Logon user history

Hi Gary, I think that another thing that you should report is the "failed login attempts", this is not displayed with last or ac.

Please see this link:

http://www.redhatmagazine.com/2007/02/20/how-do-i-use-the-faillog-program-to-track-failed-login-attempts/
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Gary L
Super Advisor

Re: RH Linux Logon user history

Thanks Ivan

The informations of failed login attempts is very usful to the report, I will add it into script.

thanks again

-Gary