Add successful login script
This commit is contained in:
parent
1f0f73bd4c
commit
695dd52dc8
6
mail.sh
6
mail.sh
@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
MAILTO=$(cat "$HOME/.admin_mail")
|
MAILTO=$(cat "/root/.admin_mail")
|
||||||
|
|
||||||
if [ -f "$HOME/.host_mail" ]; then
|
if [ -f "/root/.host_mail" ]; then
|
||||||
MAILFROM=$(cat "$HOME/.host_mail")
|
MAILFROM=$(cat "/root/.host_mail")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SUBJECT=$1
|
SUBJECT=$1
|
||||||
|
5
notify-login.sh
Executable file
5
notify-login.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$PAM_TYPE" != "close_session" ]; then
|
||||||
|
echo -e "$PAM_USER has successfully logged in on $(hostname) from $PAM_RHOST" | $(dirname $0)/mail.sh "$(hostname) SSH Login: $PAM_USER"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user