Skip to content

Instantly share code, notes, and snippets.

@noah
Forked from anonymous/sshrc
Created July 14, 2011 04:26
Show Gist options
  • 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)" [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment