Operating System - HP-UX
1833786 Members
2394 Online
110063 Solutions
New Discussion

Email notification on interactive logins?

 
SOLVED
Go to solution
Florian Heigl (new acc)
Honored Contributor

Email notification on interactive logins?

Hi,

suppose a host that only needs interactive login for maintainance purposes (estimate is something like 3 logins per month), and I'd like to make the host send out an email to the two groups of users that are allowed to log on instantly when a login occurs.

access can be via either ssh or the gsp, and I don't know where a hook for doing this exists.

I think about using the 'users' monitor in EMS, but I'm not sure if it's the right thing [tm].

Does someone have alternative ideas / experiences for me?

Florian
yesterday I stood at the edge. Today I'm one step ahead.
3 REPLIES 3
Patrick Wallek
Honored Contributor
Solution

Re: Email notification on interactive logins?

Why not just put an entry in /etc/profile or the user id's .profile to send an e-mail when a login happens?

This will work no matter how the login occurrs, be it from the console (via GSP lan console or whatever) or ssh or telnet.

I have not looked at the 'users' EMS monitor, so I can't give you much insight on that.
Geoff Wild
Honored Contributor

Re: Email notification on interactive logins?

On my linux server I have this at the end of root's .bash_profile:

echo "tail messages..." > logfile
tail /var/log/messages >> logfile
echo "who?" >> logfile
who -u >> logfile
mail -s "ROOT SIGNING IN..." gjwild@mydomain.ca < logfile

mesg n


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Florian Heigl (new acc)
Honored Contributor

Re: Email notification on interactive logins?

The obvious is the hardest to see at times :)

I wanted to log every login and it's the easiest to do it in the login process :)

I put it in /etc/profile, and also check the SSH_CONNECTION and like variables.
yesterday I stood at the edge. Today I'm one step ahead.