Skip to content

Instantly share code, notes, and snippets.

@tamr
Created September 3, 2021 19:08
Show Gist options
  • Save tamr/512aa47ee7278ed1d5c07002d6d6b51a to your computer and use it in GitHub Desktop.
Save tamr/512aa47ee7278ed1d5c07002d6d6b51a to your computer and use it in GitHub Desktop.
/etc/ssh/sshrc
#!/bin/bash
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
server_ip=`echo $SSH_CONNECTION | cut -d " " -f 3`
#server_ip="$(wget -qO- checkip.amazonaws.com)"
wget -qO /dev/null --delete-after --no-check-certificate "https://push.re/message?token=AppToken" --post-data "title=SSH+Login+on+$server_ip&message=User+$USER+just+logged+in+from+https://ipapi.co/$ip&priority=5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment