Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


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

Rep: Reputation: 37
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.

Old 05-15-2007, 08:35 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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 :}).



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 05:27 PM
process no longer logs to /var/mail/root blynn8 Linux - General 4 04-18-2006 10:11 PM
Somone please help, ive tryed everthing. Only logs in as root, Wont login as user. blackspade Linux - Security 2 08-05-2005 11:39 AM
auto mail to new user how to?? AZIMBD03 Red Hat 3 02-12-2005 05:41 PM
Getting a program to start with root privileges when a user logs in. joeking Linux - Security 4 10-24-2003 12:47 PM > Forums > Linux Forums > Linux - General

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

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