Skip to content

Instantly share code, notes, and snippets.

@vitoo
Last active August 2, 2017 18:31
Show Gist options
  • Save vitoo/8da59382a1565282ed55e78637a6a2f5 to your computer and use it in GitHub Desktop.
Save vitoo/8da59382a1565282ed55e78637a6a2f5 to your computer and use it in GitHub Desktop.
Send discord webhook at ssh login (every user)
#/etc/ssh/sshrc
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
curl --silent -v \
-H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"new login $USER $ip \"}" \
https://discordapp.com/api/webhooks/_WEBOOK_URL > /dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment