Acceso ssh lento contenedores proxmox debian 11

Llevo unos días que me encuentro que el acceso ssh de los contenedores lxc de proxmox con debian 11 es horrorosamente lento.

Si miramos el log del servicio ssh nos encontramos esto:

root@ns2:/etc/ssh# cat /var/log/auth.log
Jan  4 13:55:25 ns2 dbus-daemon[70]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
Jan  4 13:55:25 ns2 sshd[280]: pam_systemd(sshd:session): Failed to create session: Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
Jan  4 13:58:54 ns2 dbus-daemon[70]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
Jan  4 14:00:20 ns2 dbus-daemon[70]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)

El motivo es porqué el servicio systemd-logind no está levantado:

root@ns2:~# systemctl status systemd-logind
● systemd-logind.service
     Loaded: masked (Reason: Unit systemd-logind.service is masked.)
     Active: failed (Result: exit-code) since Tue 2022-01-04 14:59:55 CET; 22min ago
   Main PID: 3620 (code=exited, status=226/NAMESPACE)

Jan 04 14:59:55 ns2 systemd[1]: systemd-logind.service: Main process exited, code=exited, status=226/NAMESPACE
Jan 04 14:59:55 ns2 systemd[1]: systemd-logind.service: Failed with result 'exit-code'.
Jan 04 14:59:55 ns2 systemd[1]: Failed to start User Login Management.
Jan 04 14:59:55 ns2 systemd[1]: systemd-logind.service: Scheduled restart job, restart counter is at 5.
Jan 04 14:59:55 ns2 systemd[1]: Stopped User Login Management.
Jan 04 14:59:55 ns2 systemd[1]: systemd-logind.service: Start request repeated too quickly.
Jan 04 14:59:55 ns2 systemd[1]: systemd-logind.service: Failed with result 'exit-code'.
Jan 04 14:59:55 ns2 systemd[1]: Failed to start User Login Management.

Tenemos dos opciones, la primera es posible que tengamos que activar el nesting en el contenedor (ya configurado por defecto en proxmox 7) o la otra opción es:

Lo que detalla aquí:

root@ns2:/etc/ssh# systemctl mask systemd-logind
Created symlink /etc/systemd/system/systemd-logind.service -> /dev/null.
root@ns2:/etc/ssh# pam-auth-update

En pam-auth-update desactivamos la opción “Register user sessions in the systemd control group hierarchy”

Deixa un comentari

L'adreça electrònica no es publicarà.

Aquest lloc utilitza Akismet per reduir els comentaris brossa. Apreneu com es processen les dades dels comentaris.