Files
shell/ssh-login.sh
2023-09-01 11:24:56 +00:00

16 lines
405 B
Bash
Executable File

#!/bin/bash
#
# This script is referenced in `/etc/pam.d/sshd`
# - at the end of the `sshd` file, add
# `session optional pam_exec.so /home/acedanger/shell/ssh-login.sh`
#
if [ "${PAM_TYPE}" = "open_session" ]; then
curl \
-H prio:urgent \
-H tags:warning,ssh,login,${HOSTNAME} \
-d "SSH login [${HOSTNAME}] user ${PAM_USER} from ${PAM_RHOST}" \
https://notify.peterwood.rocks/lab
fi