[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cobalt-users] Email every SSH Login from your box !
- Subject: [cobalt-users] Email every SSH Login from your box !
- From: "Robin Edgar - Tripany" <red@xxxxxxxxxxx>
- Date: Wed Mar 12 01:47:00 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
>> /bin/echo "`cat /etc/HOSTNAME` User: `id -u` [ `cat /etc/passwd |grep
>> \`id -u\`` ] logged in" |/bin/mail -s login root@localhost
You could use `last -n 1` for the userid and originating IP, and 'id -u'
only if you really wanted to know the full permissions, so
/bin/echo "`last -n 1` logged in" | /bin/mail -s login your@xxxxxxxxx
in /etc/profile
Robin