I need to run a script everytime there is a SSH logout of user root.<= BR> Any ideas....???
Vaibhav.
[1] [adst=]
References
Afternoon Vaibhav,
I need to run a script everytime there is a SSH logout of user root.<= BR>
<snip> Write a daemon to monitor /var/log/secure. or utmp data. Please do not rely on any tool which use utmp as source data, as it depends on tool, how it counts entries in utmp.
Regards, Animesh.
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail
How about .bash_logout if the root's login shell is bash?
Amitay.
On Mon, 2004-06-21 at 11:36, vaibhav samant wrote:
I need to run a script everytime there is a SSH logout of user root.<= BR> Any ideas....???
Vaibhav.
[1] [adst=]
References
Amitay.
On Monday 21 June 2004 4:07 pm, Amitay Isaacs wrote:
How about .bash_logout if the root's login shell is bash?
Amitay.
On Mon, 2004-06-21 at 11:36, vaibhav samant wrote:
I need to run a script everytime there is a SSH logout of user root.<= BR> Any ideas....???
Since .bash_logout is executed for every logout session (provided, the shell is bash), you could check if its an ssh session by something like this in .bash_logout
[ "$SSH_TTY" != "" ] && { `w | mail -s "Logout from ssh session" your_email_id_here` }
This mails with output of w whenever a logout from ssh session occurs.
Jemshad O K
Evening Jamshad,
How about .bash_logout if the root's login shell
is bash?
Amitay.
On Mon, 2004-06-21 at 11:36, vaibhav samant wrote:
I need to run a script everytime there is a SSH
logout of user
<snip> Please refer to above question. It has to run the script while login out.
Regards, Animesh.
__________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail
Hi Animesh,
On Monday 21 June 2004 8:32 pm, Animesh Singh wrote:
Evening Jamshad,
How about .bash_logout if the root's login shell
is bash?
Amitay.
On Mon, 2004-06-21 at 11:36, vaibhav samant wrote:
I need to run a script everytime there is a SSH
logout of user
<snip> Please refer to above question. It has to run the script while login out.
I just showed an example. You can just replace that `w | mail... ` part with your script may be followed by & also to put that in background.
Jemshad
Evening Jamshed,
How about .bash_logout if the root's login
shell
<snip> .bash_logout is for bash shell. .login is for csh & tcsh shell.
So over all this is dependent on shell based.
I need to run a script everytime there is a
SSH logout of user
<snip> If u write a daemon for monitoring /var/log/secure and utmp source. U can have ssh proper trace.
Problem which can arise from these, sometime source data get damage, which gives wrong info for the other command / services. check redhat bugzilla for further details.
I just showed an example. You can just replace that `w | mail... ` part with your script may be followed by & also to put that in background.
<snip> I read ur script. but assume ssh gets uninterruptible sleep (usually IO) or into defunct ("zombie") process.
Infact source for system utility like top uses utmp data and secure is the log stamping file for sshd service.
Regards, Animesh.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com