From c78bb31b69e7ac6ba790914ca15082266cce1798 Mon Sep 17 00:00:00 2001 From: "Alexander I. Chebykin" Date: Sun, 30 Oct 2022 22:59:39 +0300 Subject: [PATCH] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 47f7a61..f4cc0a2 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ Watchdog can send notifications on user login. Just add to ```/etc/profile.d/ssh IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }') CAI_WATCHDOG_PATH=/etc/cai-watchdog source ${CAI_WATCHDOG_PATH}/inc-icons - ${CAI_WATCHDOG_PATH}//send-mail your@mail.addr '${ICON_INFO} SSH: User ${User} is logged in' '${ICON_INFO} SSH: User ${User} is logged in from ${IP}' + ${CAI_WATCHDOG_PATH}/send-mail your@mail.addr '${ICON_INFO} SSH: User ${User} is logged in' '${ICON_INFO} SSH: User ${User} is logged in from ${IP}' ``` ## User logouts monitoring (*nix) @@ -158,8 +158,9 @@ Watchdog can send notifications on user login. Just add to ```/etc/profile.d/ssh ``` #!/bin/sh + CAI_WATCHDOG_PATH=/etc/cai-watchdog if [ "$PAM_TYPE" = "close_session" ]; then - send-telegram "SSH: User is logged out" + ${CAI_WATCHDOG_PATH}/send-telegram "SSH: User ${PAM_USER} is logged out" fi ``` @@ -167,8 +168,9 @@ Watchdog can send notifications on user login. Just add to ```/etc/profile.d/ssh ``` #!/bin/sh + CAI_WATCHDOG_PATH=/etc/cai-watchdog if [ "$PAM_TYPE" = "close_session" ]; then - send-mail your@mail.addr 'SSH: User is logged out' 'SSH: User is logged out' + ${CAI_WATCHDOG_PATH}/send-mail your@mail.addr 'SSH: User ${PAM_USER} is logged out' 'SSH: User is logged out' fi ``` and set executable flag on it