[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] Email every SSH Login from your box !



>> /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