Compare commits
No commits in common. "dbb860a00bd441d88831edf186fda360ef4de9f5" and "fa6c131e9b1ea6358c832b49d4bb77f61af634c4" have entirely different histories.
dbb860a00b
...
fa6c131e9b
@ -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 }')
|
IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')
|
||||||
CAI_WATCHDOG_PATH=/etc/cai-watchdog
|
CAI_WATCHDOG_PATH=/etc/cai-watchdog
|
||||||
source ${CAI_WATCHDOG_PATH}/inc-icons
|
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)
|
## User logouts monitoring (*nix)
|
||||||
@ -158,9 +158,8 @@ Watchdog can send notifications on user login. Just add to ```/etc/profile.d/ssh
|
|||||||
|
|
||||||
```
|
```
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
CAI_WATCHDOG_PATH=/etc/cai-watchdog
|
|
||||||
if [ "$PAM_TYPE" = "close_session" ]; then
|
if [ "$PAM_TYPE" = "close_session" ]; then
|
||||||
${CAI_WATCHDOG_PATH}/send-telegram "SSH: User ${PAM_USER} is logged out"
|
send-telegram "SSH: User is logged out"
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -168,9 +167,8 @@ Watchdog can send notifications on user login. Just add to ```/etc/profile.d/ssh
|
|||||||
|
|
||||||
```
|
```
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
CAI_WATCHDOG_PATH=/etc/cai-watchdog
|
|
||||||
if [ "$PAM_TYPE" = "close_session" ]; then
|
if [ "$PAM_TYPE" = "close_session" ]; then
|
||||||
${CAI_WATCHDOG_PATH}/send-mail your@mail.addr 'SSH: User ${PAM_USER} is logged out' 'SSH: User is logged out'
|
send-mail your@mail.addr 'SSH: User is logged out' 'SSH: User is logged out'
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
and set executable flag on it
|
and set executable flag on it
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user