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

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



Hi,

I asked some days ago for this trick, and i found it back in my (to) huge
archive....
Here THE trick to send a email to a sys-admin for EVERY SSH Login.  (should
work with telnet also, but ... who need it???)

Type in SSH :
pico-w /etc/profile
Copy and paste the line below at the bottom :

/bin/echo "`cat /etc/HOSTNAME`    User: `id -u`  [ `cat /etc/passwd |grep
\`id -u\`` ]  logged in" |/bin/mail -s login root@localhost

Change the email address, because it don't have any sense to send a
(hackers) SSH login into the box....!
It emails you whenever somebody logs in and tells you their details.

If someone can tune this up, so that it show us the IP of the guy who make
the login, it will be nice ;)
Best regards
Jean