Skip to content

Instantly share code, notes, and snippets.

@lx78WyY0J5
Forked from vitoo/sshrc
Created July 23, 2025 02:33
Show Gist options
  • Select an option

  • Save lx78WyY0J5/3d061547ac21e19c1f5d93b0f2d1e452 to your computer and use it in GitHub Desktop.

Select an option

Save lx78WyY0J5/3d061547ac21e19c1f5d93b0f2d1e452 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