mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
delayed login alerts to prevent spam with mass logins
This commit is contained in:
parent
0e177210f6
commit
b1b06b2e51
8 changed files with 100 additions and 7 deletions
|
|
@ -4,8 +4,10 @@ mydir=$(dirname "$0")
|
|||
sudo "$mydir/send_login_alert.sh"
|
||||
|
||||
shell=$(getent passwd $LOGNAME | cut -d: -f7)
|
||||
if [[ -n $SSH_ORIGINAL_COMMAND ]] # command given, so run it
|
||||
if [ "$SSH_ORIGINAL_COMMAND" = "internal-sftp" ] # command given, so run it
|
||||
then
|
||||
exec /usr/lib/ssh/sftp-server
|
||||
elif [[ -n $SSH_ORIGINAL_COMMAND ]]; then
|
||||
exec "$shell" -c "$SSH_ORIGINAL_COMMAND"
|
||||
else # no command, so interactive login shell
|
||||
exec "$shell" -il
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue