Skip to content

Disable sshd socket activation first#931

Open
kuglimon wants to merge 1 commit intodev-sec:masterfrom
kouralabs:fix-ubuntu-2404-sshd-zombie
Open

Disable sshd socket activation first#931
kuglimon wants to merge 1 commit intodev-sec:masterfrom
kouralabs:fix-ubuntu-2404-sshd-zombie

Conversation

@kuglimon
Copy link

@kuglimon kuglimon commented Feb 1, 2026

Related to #854

Recently devsec hardening started to fail on fresh Ubuntu 24.04 machines. The ones we use come from Azure and update automatically, which probably explains why we suddenly started seeing this issue. Disabling the configuration first followed by delete plus reload seems to have fixes the issue in our deployments.

I'm guessing ansible keeps opening connections and the socket activation triggers as we didn't reload configuration. I don't know why just reloading the daemon wasn't enough after deleting the configuration though. Without these changes the sshd process is left in some dead state where it's still listening on the socket but refusing all connections making systemd unable to restart it.

I also locally tested these changes on Ubuntu 24.04 with molecule using this branch: #878

Ansible can open multiple connections and it's possible for a new socket
to open before activation is fully disabled, leaving a zombie sshd
process. At least that is the guess. Ubuntu 24.04 suffers from this.

Reload the configuration after disabling socket activation to not enable
it again.

Signed-off-by: Tatu Argillander <tatu.argillander@kouralabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant