Skip to content

Instantly share code, notes, and snippets.

Created July 14, 2011 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1081937 to your computer and use it in GitHub Desktop.
Save anonymous/1081937 to your computer and use it in GitHub Desktop.
#!/bin/bash
# /etc/ssh/sshrc
# watchfile
ip=$(echo $SSH_CONNECTION | awk '{print $1}')
reverse=$(dig -x $ip +short)
echo $(date) | mutt -s "ssh login: $USER@$HOSTNAME from $reverse ($ip)" noahktilton@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment