Created
December 13, 2016 13:21
-
-
Save Lewiscowles1986/4e33c8270357e87c50921a4bcb4b5544 to your computer and use it in GitHub Desktop.
Monitor SSH login to server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ip=`echo $SSH_CONNECTION | cut -d " " -f 1` | |
| logger -t ssh-wrapper $USER login from $ip | |
| echo "User $USER just logged in from $ip" | mail -s "SSH Login" "CD2 Team <[email protected]>" & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment