[Eisfair] mini_http: Zugriff verweigert

Rolf Bensch azubi at bensch-net.de
Sa Apr 8 12:44:03 CEST 2023


Hallo Marcus,

Am 07.04.23 um 17:11 schrieb Marcus Röckrath:
> Hallo Rolf,
> 
> Rolf Bensch wrote:
> 
>> Beim Update gab's eine Menge Meldungen zu "chown ... [.|:]". Könnte das
>> damit im Zusammenhang stehen?
> 
> Nein, damit hat es garantiert nichts zu tun.
> 
> Wie bei grep, weist eine "warning" daraufhin, dass man bitte auf eine andere
> Syntax umstellen möge, die Funktion ist derzeit aber noch wie vorher.
> 
> Wie bei grep soll die alternative Syntax aber in absehbarer Zeit verboten
> sein.
> 
> Wenn das mini_httpd-Problem mit den Updates zusammenhängt, dann IMHO mit
> einem Tool der coreutils.
> 
> Du kannst aber mal schreiben, welche Updates du heute installiert
> hast: /var/log/log.eis-install.
> 

Da wurden ziemlich viele Libs aktualisiert - aber auch coreutils. Mir fehlt jetzt noch der Zusammenhang zum passenden Tool bzw. der Fingerzeig auf die Ursache.

Sachstand: mini_http ist seit langer Zeit unverändert im Version und Konfiguration. Ein aktueller Zugriff darauf erzeugt eine Passwortabfrage und mündet in einem 401-Fehler (access denied). Im Logfile dazu:

    192.168.0.101 - - [08/Apr/2023:12:21:33 +0200] "GET / HTTP/1.1" 401 - "" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0"

Für mich ein Indiz dafür, dass der Server läuft, der Mechanismus zur Authentifizierung am geplättet wurde.

Aktiviere ich im Paket den debug-Modus:

    Activate configuration now (y/n) [yes]?

    mini_httpd version: v2.3.4
    http port: 8080
    creating certificate link ...
    creating mini_httpd configuration ...
    creating logrotate configuration file ...
    processing user(s) ...
    - xxx
    - yyy
    - zzz
    setting file/directory access rights ...
    checking access log menue entry ...
    checking ssl port setting ...
    finished.
     * Restarting mini_httpd.service ...
    Job for mini_httpd.service failed because a timeout was exceeded.
    See "systemctl status mini_httpd.service" and "journalctl -xeu mini_httpd.service" for details.                  [ FAIL ]
    Press ENTER to continue

Der Anweisung folgend:
    # journalctl -xeu mini_httpd.service
    ...
    Apr 08 12:19:03 ibs-server mini_httpd[30072]:  * Stopping Mini_HTTPD-Webserver ...
    Apr 08 12:19:04 ibs-server mini_httpd[30072]: [26B blob data]
    Apr 08 12:19:04 ibs-server systemd[1]: mini_httpd.service: Deactivated successfully.
    ░░ Subject: Unit succeeded
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ The unit mini_httpd.service has successfully entered the 'dead' state.
    Apr 08 12:19:04 ibs-server systemd[1]: Stopped mini_httpd.service.
    ░░ Subject: A stop job for unit mini_httpd.service has finished
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ A stop job for unit mini_httpd.service has finished.
    ░░
    ░░ The job identifier is 132638 and the job result is done.
    Apr 08 12:19:04 ibs-server systemd[1]: Starting mini_httpd.service...
    ░░ Subject: A start job for unit mini_httpd.service has begun execution
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ A start job for unit mini_httpd.service has begun execution.
    ░░
    ░░ The job identifier is 132638.
    Apr 08 12:19:04 ibs-server mini_httpd[30084]:  * Starting Mini_HTTPD-Webserver ...
    Apr 08 12:24:04 ibs-server systemd[1]: mini_httpd.service: start operation timed out. Terminating.
    Apr 08 12:24:04 ibs-server systemd[1]: mini_httpd.service: Failed with result 'timeout'.
    ░░ Subject: Unit failed
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ The unit mini_httpd.service has entered the 'failed' state with result 'timeout'.
    Apr 08 12:24:04 ibs-server systemd[1]: mini_httpd.service: Unit process 30094 (mini_httpd) remains running after unit stopped.
    Apr 08 12:24:04 ibs-server systemd[1]: Failed to start mini_httpd.service.
    ░░ Subject: A start job for unit mini_httpd.service has failed
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ A start job for unit mini_httpd.service has finished with a failure.
    ░░
    ░░ The job identifier is 132638 and the job result is failed.

Ohne Debug-Modus startet der Server durch:

    /usr/sbin/service status mini_httpd
    │● mini_httpd.service
    │     Loaded: loaded (/etc/init.d/mini_httpd; generated)
    │     Active: active (running) since Sat 2023-04-08 12:31:31 CEST; 4s ago
    │       Docs: man:systemd-sysv-generator(8)
    │    Process: 30232 ExecStart=/etc/init.d/mini_httpd start (code=exited, status=0/SUCCESS)
    │      Tasks: 1 (limit: 4915)
    │        CPU: 64ms
    │     CGroup: /system.slice/mini_httpd.service
    │             └─30094 /usr/sbin/mini_httpd -C /etc/httpd/mini_httpd.conf -D
    │
    │Apr 08 12:31:31 ibs-server systemd[1]: Starting mini_httpd.service...
    │Apr 08 12:31:31 ibs-server systemd[1]: Started mini_httpd.service.
    │Press ENTER to continue

Es existieren index-Datein für den Server:
    # ls -l /usr/local/htdocs/index.*
    -r-x------ 1 root root 1660 Oct 11  2020 /usr/local/htdocs/index.cgi
    -r-------- 1 root root  206 Oct 11  2020 /usr/local/htdocs/index.html

Deaktiviere ich die Authentifizierung (MINI_HTTPD_USER_N = 0), funktioniert der Server erwartungsgemäß. Der Server ist nur intern erreichbar, daher könnte ich damit leben. Bin aber auch gerne zu weiterer Analyse bereit.

Grüße

Rolf


Mehr Informationen über die Mailingliste Eisfair