We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9b53bc commit 4d48c5dCopy full SHA for 4d48c5d
examples/example_desktop_notifications.sh examples/linux-desktop-notifications/notify-desktop.sh
examples/ssh-login-alert/ntfy-ssh-login.sh
@@ -0,0 +1,7 @@
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
+
5
+if [ "${PAM_TYPE}" = "open_session" ]; then
6
+ echo -en "\u26A0\uFE0F SSH login to $(hostname): ${PAM_USER} from ${PAM_RHOST}" | curl -T- ntfy.sh/alerts
7
+fi
examples/ssh-login-alert/pam_sshd
@@ -0,0 +1,8 @@
+# PAM config file snippet
+#
+# Put this snippet AT THE END of the file /etc/pam.d/sshd
+# See https://geekthis.net/post/run-scripts-after-ssh-authentication/ for details.
+# (lots of stuff here ...)
8
+session optional pam_exec.so /usr/local/bin/ntfy-ssh-login.sh
examples/example_eventsource_sse.html examples/web-example-eventsource/example-ssh.html
0 commit comments