I know how to do a simple hello world bash, but the knowledge stops there. I'd like to have a script that keeps track of log on/log off times of users and outputs that info to readable file. Not sure if this is possible or not, but any help pertaining to it would be very much appreciated. I have gotten as far as finding that wtmp records that activity, but I need to actually do something with it lol.

Dunno if this is possible (don't have a test machine at the moment).But you should look into the "last" command which reads and formats wtmp. It should have a feature to show logon/logoff. Per default i believe it shows last logged in time.

Otherwise there's lots of good auditing tools out there that keeps track of things like this

Ok, I made a script to log those events, but I didn't really understand what I wanted it to do until I did it. What I'm really looking for is a way to make that script run every 6-12 hours and keep that file updated with all the login/log out times for users. Any clue how I would script it to do this?

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum