[Sunhelp] su notification

Brian Scanlan singer at redbrick.dcu.ie
Mon Feb 21 15:17:39 CST 2000


On Mon, Feb 21, 2000 at 10:16:03PM +0200, Moshe Levy wrote:
> How can i configure solaris to send email to root when ever (and soon
> as) some user is makeing 'su' to some other account ?
> and notify in the mail who made 'su' and to which account.

Perhaps put something like this in your crontab?

#!/sbin/sh

DATE=`date "+%Y/%m.%d.%H.%M.%S"`
touch /var/log/sulog
cp /var/log/sulog /var/log/sulog.$DATE
cat /dev/null>/var/log/sulog

if [ -s /var/log/sulog.$DATE ]
then
mail root </var/log/sulog.$DATE
fi

There's a small race condition in there though. Run it as root, and un-nice it
:)

I tend to just tail logs myself.

Brian.






More information about the SunHELP mailing list