Philipp Heckel 4 лет назад
Родитель
Сommit
4d48c5dc34

+ 0 - 0
examples/example_desktop_notifications.sh → examples/linux-desktop-notifications/notify-desktop.sh


+ 7 - 0
examples/ssh-login-alert/ntfy-ssh-login.sh

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

+ 8 - 0
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 ...)
+
+session optional pam_exec.so /usr/local/bin/ntfy-ssh-login.sh

+ 0 - 0
examples/example_eventsource_sse.html → examples/web-example-eventsource/example-ssh.html