User Login Monitor Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting User Login Monitor Script
# 1  
Old 02-07-2005
User Login Monitor Script

I need some help writing a script that I can run as a cron job. I want this script to be able find all the users that have logged on to this machine since the last time the script was run (plan to run daily at 11:30pm, so everyone who logged on that day) and email me who logged on, and when.

My main issue is that I do not know where of if linux/unix servers store this time of information that I can parse out. I have preference as to scripting language, ksh, perl, c, just as long as it works. If it helps, I'm trying to run it on Solaris 9 and above, but would like it to run on linux machines like SUSE 9.2 as well.
# 2  
Old 02-07-2005
'man last' [on Solaris] gives this:
Quote:
last - display login and logout information about users and
terminals
This is something to start with - maybe Googlin' would help as well.
# 3  
Old 02-07-2005
thanks, that is exactly what I needed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Login into another user from user inside script

now i have logged in username : ramesh in unix Now i have to created script file to login into another user and have run a command inside that user and after executing the command i have to exit from that user. Inside script, i have to login into su - ram along with password : haihow and have to... (4 Replies)
Discussion started by: rammm
4 Replies

2. Shell Programming and Scripting

Need help on shell script to monitor each user cpu use on a cluster over time

Hi, I am relatively new to the cluster administration and shell scripting. I need help on a shell script which can help me determine how many cpu's over time, any particular ( or all registered users on a cluster ) are using. To generate data say over a period of week and list of users and their... (6 Replies)
Discussion started by: anuj06
6 Replies

3. Shell Programming and Scripting

How to Login as another user through Shell script from current user[Not Root]

Hi Every body, I would need a shell script program to login as different user and perform some copy commands in the script. example: Supppose ora_toms is the active user ora_toms should be able to run a script where user: ftptomsp pass: XXX should login through and run the commands ... (9 Replies)
Discussion started by: ujjwal27
9 Replies

4. Shell Programming and Scripting

FreeBSD new user login script

I am a beginner programmer and would like to know where to start to modify the login process so that a user can login as username new password new and have it prompt user for username and password and nothing else and then create said user account on the system so they can ssh back in and login... (9 Replies)
Discussion started by: deshi
9 Replies

5. Emergency UNIX and Linux Support

Limiting a user to a script upon login, nothing else.

Hi there, I have a Debian 5.0 server that my company uses for deployment testing. This server needs to be accessed by NOC people that have no NIX knowledge whatsoever. I am creating a bash script for a menu-based command interface for the commands they need to run on their testing routines,... (21 Replies)
Discussion started by: ppucci
21 Replies

6. UNIX for Dummies Questions & Answers

User login monitoring script.

Hi guys, I'm need to write a script that runs an infinite loop to check users that login/out of a server. I'm just not sure about the syntax with while loops and whether or not you can include a nested if-statement? Cheers Spaulds (2 Replies)
Discussion started by: Spaulds
2 Replies

7. Shell Programming and Scripting

Running script from other user rather than login user

Hi, My requirement is that i am login from ROOT in a script but when any command is coming which is logging to sqlplus then i have to run it with normal user as only normal user have permission to connect to sqlplus . i tried making a script like this : #! /bin/ksh su -... (3 Replies)
Discussion started by: rawatds
3 Replies

8. Shell Programming and Scripting

SSH login with user name and script.

I want to login to server using ssh or telnet and execute one command then exit to the shell Please let me know how to write script for this? (1 Reply)
Discussion started by: svenkatareddy
1 Replies

9. Shell Programming and Scripting

login to different user completely within the script

I am trying to write a script where I would login to a userid with id and password while staying completely within the script. I am doing this in order to edit a file where I change permissions. The objective is to allow one user only to edit a file. This is what I have now. cd $HOME/data ... (1 Reply)
Discussion started by: yakdiver
1 Replies

10. UNIX for Dummies Questions & Answers

user login script question

hi all, what file(s) needs to be changed and in what way in order to do the following: when user A logs onto freebsd 4.8 automaticaly he needs to start up a script a made that executes: sets ltp0 in polling mode, executes tn5250 keyboard mapping starts tn5250 with the correct parameters. ... (2 Replies)
Discussion started by: termiEEE
2 Replies
Login or Register to Ask a Question