mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-12 05:35:19 +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
|
||||
|
|
|
|||
4
wrappers/send_local_login_alert.sh
Executable file
4
wrappers/send_local_login_alert.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
mydir=$(dirname "$0")
|
||||
"$mydir/../.venv/bin/python" "$mydir/../send_login_alert.py" "local-only"
|
||||
Loading…
Add table
Add a link
Reference in a new issue