Ich bin sicher, dass die Ursache des Problems bei KeyHelp liegt
(Probleme ohne KeyHelp-Bezug gehören ins Offtopic-Forum)
JEIN
Server-Betriebssystem + Version
(z.B. Ubuntu 20.04)
Debian 11.7
Eingesetzte Server-Virtualisierung-Technologie
(z.B. keine, OpenVZ, KVM, XEN, etc.)
KVM
KeyHelp-Version + Build-Nummer
(z.B. 22.0 - Build 2366)
Version 23.2.1 3125
Problembeschreibung / Fehlermeldungen
Wenn ich auf die Fail2ban-Verwaltung gehe, bekomme ich 1. keine Einträge zu sehen und 2. eine Email mit folgendem Inhalt:
mail.web4you-gmbh.ch : Nov 1 10:00:28 : keyhelp : a password is required ; PWD=/home/keyhelp/www/keyhelp ; USER=root ; COMMAND=/usr/local/bin/fail2ban-client status
In der Kommandozeile funktioniert die Statusabfrage als root ohne Probleme.
Erwartetes Ergebnis
Anzeige der gesperrten IPs in der Fail2ban-Verwaltung
Tatsächliches Ergebnis
Schritte zur Reproduktion
Zusätzliche Informationen
(z.B. kürzlich durchgeführte Änderungen am Server, Auszüge aus Protokolldateien (/var/log/*, /var/log/keyhelp/php-error.log, etc.))
Ich fahre noch Debian 11. Werde demnächst auf 12 Upgraden. Meine Fail2ban-client Version ist 0.11.2
Fail2ban-Verwaltung [GELÖST]
- juergschwarz
- Posts: 80
- Joined: Fri 3. Apr 2020, 09:49
Re: Fail2ban-Verwaltung
Hallo,
wie sehen /etc/sudoers und /etc/sudoers.d/keyhelp aus?
wie sehen /etc/sudoers und /etc/sudoers.d/keyhelp aus?
Mit freundlichen Grüßen / Best regards
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
- juergschwarz
- Posts: 80
- Joined: Fri 3. Apr 2020, 09:49
Re: Fail2ban-Verwaltung
/etc/sudoers
/etc/sudoers.d/keyhelp
Code: Select all
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "@include" directives:
@includedir /etc/sudoers.d
Code: Select all
# Manage system services
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/service
# Mail queue management
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/postsuper
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/postcat
# Server reboot
keyhelp ALL = (ALL) NOPASSWD: /sbin/reboot
# Process management
keyhelp ALL = (ALL) NOPASSWD: /bin/kill
# Disk usage
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/du
keyhelp ALL = (ALL) NOPASSWD: /bin/ls
# Firewall
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/iptables, /sbin/iptables
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/iptables-restore, /sbin/iptables-restore
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/iptables-save, /sbin/iptables-save
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/ip6tables, /sbin/ip6tables
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/ip6tables-restore, /sbin/ip6tables-restore
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/ip6tables-save, /sbin/ip6tables-save
# Dovecot active sessions
keyhelp ALL = (root) NOPASSWD: /usr/bin/doveadm who
# API - Export account system passwords
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/getent
# Backup
keyhelp ALL = (ALL) NOPASSWD:SETENV: /usr/local/bin/restic
keyhelp ALL = (ALL) NOPASSWD: /bin/chown
# Fail2Ban management
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/fail2ban-client
# Socket status - Allow full output when using the "--extended" parameter of "ss"
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/ss, /bin/ss
# Last line must be empty, do not trim!
~
Re: Fail2ban-Verwaltung [GELÖST]
Bei dir befindet sich das fail2ban-client binary nicht hier
/usr/bin/fail2ban-client
sondern hier
/usr/local/bin/fail2ban-client
---
Ergänze also den anderen Pfad in der /etc/sudoers.d/keyhelp:
Vorher:
Nachher:
/usr/bin/fail2ban-client
sondern hier
/usr/local/bin/fail2ban-client
---
Ergänze also den anderen Pfad in der /etc/sudoers.d/keyhelp:
Vorher:
Code: Select all
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/fail2ban-client
Code: Select all
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/fail2ban-client, /usr/local/bin/fail2ban-client
Mit freundlichen Grüßen / Best regards
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************