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

Tags
Author: UltratechHost - Replies: 0 - Views: 4671
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.

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

This little code get