Skip to content

fix: install drop-in ahead of other sshd_config.d files - #1

Merged
autoantohaki merged 1 commit into
mainfrom
fix/dropin-precedence
Oct 21, 2026
Merged

autoantohaki merged 1 commit into
mainfrom
fix/dropin-precedence

Conversation

@autoantohaki

Copy link
Copy Markdown
Member

Before: ssh-guard apply installed sshd_config.d/99-dispersal-wolves.conf. sshd keeps the first value it reads, and Include sshd_config.d/*.conf expands in lexical order, so any earlier drop-in won. On Ubuntu cloud images 50-cloud-init.conf sets PasswordAuthentication yes, so the post-install audit failed and apply rolled itself back.

After: the default destination is 00-dispersal-wolves.conf, which is read before other drop-ins, so the hardened values take effect.

How: renamed the default drop-in path and added a test where a 50-cloud-init.conf sets PasswordAuthentication yes alongside the default drop-in; the parser now reports no. Hosts that already have the old 99- file keep it; it is harmless but can be removed.

Tests: python -m unittest discover -s tests -v (new test fails on main, passes here).

sshd keeps the first value it reads for most keywords, and Include
expands sshd_config.d/*.conf in lexical order. A 99- drop-in therefore
loses to files such as Ubuntu's 50-cloud-init.conf, and apply rolls
itself back. Name it 00-dispersal-wolves.conf so it is read first.
@autoantohaki
autoantohaki merged commit 256c34a into main Oct 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant