ntfy-ssh-login.sh 324 B

1234567
  1. #!/bin/bash
  2. # This is a PAM script hook that shows how to notify you when
  3. # somebody logs into your server. Place at /usr/local/bin/ntfy-ssh-login.sh (with chmod +x!).
  4. if [ "${PAM_TYPE}" = "open_session" ]; then
  5. echo -en "\u26A0\uFE0F SSH login to $(hostname): ${PAM_USER} from ${PAM_RHOST}" | curl -T- ntfy.sh/alerts
  6. fi