Fehlermeldung bei Status zurücksetzen auf DB Status Seite  [GELÖST]

Haben Sie einen Bug entdeckt? Teilen Sie es uns mit.
Post Reply
l_fish
Posts: 173
Joined: Tue 15. Aug 2017, 11:49

Fehlermeldung bei Status zurücksetzen auf DB Status Seite

Post by l_fish »

Ich bin sicher, dass die Ursache des Problems bei KeyHelp liegt
(Probleme ohne KeyHelp-Bezug gehören ins Offtopic-Forum)

Ja, vermutlich.

Server-Betriebssystem + Version
(z.B. Ubuntu 20.04)

Debian 11.11

Eingesetzte Server-Virtualisierung-Technologie
(z.B. keine, OpenVZ, KVM, XEN, etc.)

keine

KeyHelp-Version + Build-Nummer
(z.B. 22.0 - Build 2366)

25.0 (Build 3398)

Problembeschreibung / Fehlermeldungen

Beim Klick auf "Status zurücksetzen" in der Datenbank-Status Seite kommt folgender Fehler:
"Der Datenbank-Status konnte nicht zurückgesetzt werden."

Außerdem erhalte ich eine Mail mit Betreff: *** SECURITY information for host ***
und Inhalt:

host : Feb 5 13:02:00 : keyhelp : a password is required ; PWD=/home/keyhelp/www/keyhelp ; USER=root ; COMMAND=/bin/systemctl restart mysql


Erwartetes Ergebnis

Status wird ohne Fehler zurück gesetzt

Tatsächliches Ergebnis

s.o.

Schritte zur Reproduktion

s.o.

Zusätzliche Informationen

Da vermutlich ein sudo-Problem, füge ich mal meine sudoers configs hinzu:

Code: Select all

root@web:~# cat /etc/sudoers
#
# 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

#Allow nagios to run certain plugins as root
nagios  ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/check_megaraid_sas

Code: Select all

root@web:~# cat /etc/sudoers.d/keyhelp 
# Manage system services
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/systemctl

# 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, /usr/local/bin/fail2ban-client

# Socket status - Allow full output when using the "--extended" parameter of "ss"
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/ss, /bin/ss

# Mail queue - Allow direct access to /var/spool/postfix/*
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/find

# Disk overview - Allow display of remote file systems
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/df, /bin/df

# Last line must be empty, do not trim!
User avatar
Alexander
Keyweb AG
Posts: 4448
Joined: Wed 20. Jan 2016, 02:23

Re: Fehlermeldung bei Status zurücksetzen auf DB Status Seite  [GELÖST]

Post by Alexander »

Deine /etc/sudoers sieht nicht korrekt aus.

Schau einmal hier für ein Debian 11: https://www.diffchecker.com/99otXKNf/

Hier musst du anpassen:
#includedir /etc/sudoers.d -> @includedir /etc/sudoers.d
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
**************************************************************
l_fish
Posts: 173
Joined: Tue 15. Aug 2017, 11:49

Re: Fehlermeldung bei Status zurücksetzen auf DB Status Seite

Post by l_fish »

Alexander wrote: Wed 5. Feb 2025, 14:19 Hier musst du anpassen:
#includedir /etc/sudoers.d -> @includedir /etc/sudoers.d
Habe ich gemacht, gleicher Fehler bleibt. Wenn ich mir die Fehlermail so anschaue, dann versucht keyhelp /bin/systemctl aufzurufen, in der /etc/sudoers.d/keyhelp steht aber

Code: Select all

# Manage system services
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/systemctl
ich habe dort mal /bin/systemctl ergänzt und damit funktioniert es:

Code: Select all

# Manage system services
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/systemctl, /bin/systemctl
Ein ähnliches Problem hatten wir übrigens schon mal mit /usr/bin/df vs. /bin/df, siehe viewtopic.php?p=49345#p49345
User avatar
Alexander
Keyweb AG
Posts: 4448
Joined: Wed 20. Jan 2016, 02:23

Re: Fehlermeldung bei Status zurücksetzen auf DB Status Seite

Post by Alexander »

Du scheinst ein guter Indikator für solche Fälle zu sein, vll frag ich vorher immer mal bei dir nach, wo sich bei deinem OS-Image die Binarys befinden ;).
Darf man erfahren, bei welchem Hoster du bist?

Ich nehme im nächsten Update dann "/bin/systemctl" mit auf.
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
**************************************************************
User avatar
24unix
Posts: 2037
Joined: Sun 21. Jun 2020, 17:16
Location: Kollmar
Contact:

Re: Fehlermeldung bei Status zurücksetzen auf DB Status Seite

Post by 24unix »

Alexander wrote: Wed 5. Feb 2025, 15:58 Du scheinst ein guter Indikator für solche Fälle zu sein, vll frag ich vorher immer mal bei dir nach, wo sich bei deinem OS-Image die Binarys befinden ;).
Darf man erfahren, bei welchem Hoster du bist?

Ich nehme im nächsten Update dann "/bin/systemctl" mit auf.
Evtl. bei der Installation sicherstellen, dass usermerge installiert ist?
Cheers Micha
--
A Windows user reinstalls software every few weeks.
A Linux user reinstalls software every few weeks.
The difference is with Linux the version numbers change.
l_fish
Posts: 173
Joined: Tue 15. Aug 2017, 11:49

Re: Fehlermeldung bei Status zurücksetzen auf DB Status Seite

Post by l_fish »

Alexander wrote: Wed 5. Feb 2025, 15:58 Du scheinst ein guter Indikator für solche Fälle zu sein, vll frag ich vorher immer mal bei dir nach, wo sich bei deinem OS-Image die Binarys befinden ;).
Darf man erfahren, bei welchem Hoster du bist?

Ich nehme im nächsten Update dann "/bin/systemctl" mit auf.
Klar, du kannst gern bei uns drauf schauen. Das geht sogar recht unkompliziert, denn das sind Server von euch ;)

Die Server sind von 2017 und haben somit schon Dist-Upgrades von 9 => 10 => 11 hinter sich. Vielleicht liegt es ja daran.
Post Reply