LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-15-2007, 02:17 AM   #1
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 39
auto mail to root when a particular user logs in via ssh


Hi all,
I want to know if its possible to write a script, so that, if one particular user logs in using ssh then a mail
will be sent to the root account.

Thanks.
 
Old 05-15-2007, 07:35 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Not per "trigger". It would be easy enough, though, to have a script look at
the appropriate logfile (/var/log/auth.log in Slackware) and grep for the user
name and login-method in a timed loop, and send an e-Mail on success (of course,
you'll want to check the time-stamp, too, and keep it as a flag so you don't
get re-alerted for the same event every XX seconds :}).


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 04:27 PM
process no longer logs to /var/mail/root blynn8 Linux - General 4 04-18-2006 09:11 PM
Somone please help, ive tryed everthing. Only logs in as root, Wont login as user. blackspade Linux - Security 2 08-05-2005 10:39 AM
auto mail to new user how to?? AZIMBD03 Red Hat 3 02-12-2005 04:41 PM
Getting a program to start with root privileges when a user logs in. joeking Linux - Security 4 10-24-2003 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration