Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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