Skip to content

Instantly share code, notes, and snippets.

@noah
Forked from anonymous/sshrc
Created July 14, 2011 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noah/1081938 to your computer and use it in GitHub Desktop.
Save noah/1081938 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