Computing.Net > Forums > Unix > Monitoring logons

Monitoring logons

Reply to Message Icon

Original Message
Name: ccurt1
Date: December 26, 2003 at 08:16:58 Pacific
Subject: Monitoring logons
OS: win xp
CPU/Ram: 512 ram
Comment:

Hi I have a problem with users logging on to a unix server and am trying to see if there is a way to track the users , logon time and commands they are using. Quite problematic not knowing when strange problems occur with the unix server.
Thanks , Cman


Report Offensive Message For Removal


Response Number 1
Name: westwood01
Date: December 27, 2003 at 05:02:38 Pacific
Subject: Monitoring logons
Reply: (edit)

If you have root on this system, you may want to try this.

I added the following line to each users .profile to start tracking user logins. This will just send you mail as soon as the user logs in, which saves you from logging on to the system and checking often. Just besure your sendmail queue is set low, like a few seconds, not like the default which i think is 15 minutes, so you will know right away.

last -a|head|mailx -s "server1 user1 login `date +\%c`" YourEmailHere@work.com

As far as watching commands used, you may want to run some kind of snoop or network/system sniffer to monitor activity.


Report Offensive Follow Up For Removal

Response Number 2
Name: WilliamRobertson
Date: December 27, 2003 at 05:20:06 Pacific
Subject: Monitoring logons
Reply: (edit)

Haven't tried this but presumably you could place the code in /etc/profile rather than repeating it everywhere. I would be concerned about the number of e-mails you might generate though.

If you don't need e-mail alerts, last on its own might be enough.


Report Offensive Follow Up For Removal

Response Number 3
Name: anonproxy
Date: December 31, 2003 at 19:50:16 Pacific
Subject: Monitoring logons
Reply: (edit)

Look at sudoscript. Perl source here. Freshmeat. manpage. Just recently got support for non-root users.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Monitoring logons

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software