various fixed

This commit is contained in:
bee
2026-07-04 22:54:09 +02:00
parent 6873ef44e4
commit 59aa8a7bcf
7 changed files with 27 additions and 10 deletions
+2 -2
View File
@@ -4,12 +4,12 @@ case "$SSH_ORIGINAL_COMMAND" in
"ban "*)
ip="${SSH_ORIGINAL_COMMAND#ban }"
[[ "$ip" =~ ^[0-9.]+$|^[0-9a-fA-F:]+$ ]] || { echo "bad ip"; exit 1; }
exec fail2ban-client set sshd banip "$ip"
exec sudo /usr/bin/fail2ban-client set sshd banip "$ip"
;;
"unban "*)
ip="${SSH_ORIGINAL_COMMAND#unban }"
[[ "$ip" =~ ^[0-9.]+$|^[0-9a-fA-F:]+$ ]] || { echo "bad ip"; exit 1; }
exec fail2ban-client set sshd unbanip "$ip"
exec sudo /usr/bin/fail2ban-client set sshd unbanip "$ip"
;;
*)
echo "denied" >&2; exit 1