Update README.md

This commit is contained in:
Alexander I. Chebykin 2022-07-01 12:12:26 +03:00
parent 48cc6af869
commit 3976307952

View File

@ -113,15 +113,19 @@ If you want to get messages when watchdog service is stopped, uncomment followin
Watchdog can send notifications on user login. Just add to ```/etc/profile.d/sshinfo.sh``` next lines:
- For Telegram:
1. ```User=$(whoami)```
1. ```IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')```
1. ```ICON_INFO=$(echo -e "\U2139")```
1. ```send-telegram "${ICON_INFO} SSH: User ${User} is logged in from ${IP}"```
```
User=$(whoami)
IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')
ICON_INFO=$(echo -e "\U2139")
send-telegram "${ICON_INFO} SSH: User ${User} is logged in from ${IP}"
```
- For e-mail:
1. ```User=$(whoami)```
1. ```IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')```
1. ```ICON_INFO=$(echo -e "\U2139")```
1. ```send-mail your@mail.addr '${ICON_INFO} SSH: User ${User} is logged in' '${ICON_INFO} SSH: User ${User} is logged in from ${IP}'```
```
User=$(whoami)
IP=$(echo $SSH_CONNECTION | awk '{ print $1 == "" ? "127.0.0.1" : $1 }')
ICON_INFO=$(echo -e "\U2139")
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)