Welcome to UltratechHost Forum, Guest. Please take the time to register if you haven't, or click

Author: UltratechHost - Replies: 0 - Views: 4391
Alert when an login is done to SSH server
For added security, I modified the .bashrc profile for any users that may have shell access, and added the following, so that when the user logs in, it sends out an email, letting you know that someone has logged in.

echo ‘ALERT – Root Shell Access (YourserverName) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” you@yourdomain.com
Of course, you need to modify the (Yourservername) and you@yourdomain.com part.

This little code get