From 39763079520fc3cfd1f17006bfc41f0df3d08a1e Mon Sep 17 00:00:00 2001 From: "Alexander I. Chebykin" Date: Fri, 1 Jul 2022 12:12:26 +0300 Subject: [PATCH] Update README.md --- README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bf2acf7..e829c92 100644 --- a/README.md +++ b/README.md @@ -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) -- 2.51.0