Update README.md

This commit is contained in:
Alexander I. Chebykin 2022-10-30 22:59:39 +03:00
parent 85654f51a0
commit c78bb31b69

View File

@ -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