An sshd role: a hardening drop-in for OpenSSH. Proposal first, because the README lists SSH as in scope and I do not know whether you already have this role queued for extraction from your own repository.
Why
SSH is the first thing a home lab exposes and the first thing that locks you out when it is configured badly. A reusable role that does the well-known things correctly saves every user from rediscovering them:
A drop-in file named 00-ansible-hardening.conf: sshd keeps the first value it reads and reads sshd_config.d/*.conf in name order, so a later-sorting file loses to cloud-init's 50-cloud-init.conf (PasswordAuthentication yes on Ubuntu cloud-image VMs). 00- makes the hardening win.
Sensible defaults (key-only authentication, MaxAuthTries, no forwarding, modern KEX/cipher/MAC lists), merged with consumer overrides.
The config validated with sshd -t before the service is reloaded, so a typo cannot lock the host out.
Profiles per system type, mirroring the system_type profiles of system_baseline, so a hypervisor and a container can differ.
Scope of what I would send
About 10 files, roughly 200 lines. Generic by construction; what I would strip before sending: references to my hosts and issue numbers in comments, the coupling to ansible_user, and a profile name that only makes sense in my inventory. Role vars would be sshd_-prefixed, typed in argument_specs.yml, with a molecule scenario on both Ubuntu images.
Questions for the maintainer
Is this role already queued from your environment repository? If so I will not duplicate it, and would rather review it.
Do you want profiles, or a flat sshd_settings mapping that consumers override?
## What
An `sshd` role: a hardening drop-in for OpenSSH. Proposal first, because the README lists SSH as in scope and I do not know whether you already have this role queued for extraction from your own repository.
## Why
SSH is the first thing a home lab exposes and the first thing that locks you out when it is configured badly. A reusable role that does the well-known things correctly saves every user from rediscovering them:
- A drop-in file named `00-ansible-hardening.conf`: sshd keeps the **first** value it reads and reads `sshd_config.d/*.conf` in name order, so a later-sorting file loses to cloud-init's `50-cloud-init.conf` (`PasswordAuthentication yes` on Ubuntu cloud-image VMs). `00-` makes the hardening win.
- Sensible defaults (key-only authentication, `MaxAuthTries`, no forwarding, modern KEX/cipher/MAC lists), merged with consumer overrides.
- The config validated with `sshd -t` before the service is reloaded, so a typo cannot lock the host out.
- Profiles per system type, mirroring the `system_type` profiles of `system_baseline`, so a hypervisor and a container can differ.
## Scope of what I would send
About 10 files, roughly 200 lines. Generic by construction; what I would strip before sending: references to my hosts and issue numbers in comments, the coupling to `ansible_user`, and a profile name that only makes sense in my inventory. Role vars would be `sshd_`-prefixed, typed in `argument_specs.yml`, with a molecule scenario on both Ubuntu images.
## Questions for the maintainer
- Is this role already queued from your environment repository? If so I will not duplicate it, and would rather review it.
- Do you want profiles, or a flat `sshd_settings` mapping that consumers override?
Understood, and thanks for saying so before any code landed. I will not open a PR for this.
For reference only: I had already prepared a local, unpushed sshd role branch (a drop-in named 00- so it sorts before cloud-init's 50-cloud-init.conf, a settings mapping merged over defaults, sshd -t before the reload with restore on failure, validation that refuses Match/Include, and a Molecule scenario that has not run). If it helps your migration, say so and I will share it (as a branch or a diff); otherwise it stays local and I will delete it once your role lands. I would be glad to review your version instead.
Assisted-by: Claude Code
Understood, and thanks for saying so before any code landed. I will not open a PR for this.
For reference only: I had already prepared a local, unpushed `sshd` role branch (a drop-in named `00-` so it sorts before cloud-init's `50-cloud-init.conf`, a settings mapping merged over defaults, `sshd -t` before the reload with restore on failure, validation that refuses `Match`/`Include`, and a Molecule scenario that has not run). If it helps your migration, say so and I will share it (as a branch or a diff); otherwise it stays local and I will delete it once your role lands. I would be glad to review your version instead.
Assisted-by: Claude Code
Labelled Reviewed/Duplicate and withdrawn by the proposer, but still Status/Ready for Human. Recommend the maintainer closes it. (From Order of the implementation backlog, #198.)
Labelled Reviewed/Duplicate and withdrawn by the proposer, but still Status/Ready for Human. Recommend the maintainer closes it. (From Order of the implementation backlog, #198.)
Review of the map (2026-11-15): corrections to this issue.
The proposal is now moot, not only a duplicate. The sshd role has merged and shipped in release 1.6.0 (roles/sshd/; CHANGELOG.rst:13, "Adds the sshd role"). The labels still contradict each other: Reviewed/Duplicate says nothing is left to do, Status/Ready for Human says the maintainer has an action. The maintainer can close this issue as completed by the sshd role; the proposer has offered to review that version instead.
Review of the map (2026-11-15): corrections to this issue.
- **The proposal is now moot, not only a duplicate.** The `sshd` role has merged and shipped in release 1.6.0 (`roles/sshd/`; `CHANGELOG.rst:13`, "Adds the sshd role"). The labels still contradict each other: `Reviewed/Duplicate` says nothing is left to do, `Status/Ready for Human` says the maintainer has an action. The maintainer can close this issue as completed by the `sshd` role; the proposer has offered to review that version instead.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
An
sshdrole: a hardening drop-in for OpenSSH. Proposal first, because the README lists SSH as in scope and I do not know whether you already have this role queued for extraction from your own repository.Why
SSH is the first thing a home lab exposes and the first thing that locks you out when it is configured badly. A reusable role that does the well-known things correctly saves every user from rediscovering them:
00-ansible-hardening.conf: sshd keeps the first value it reads and readssshd_config.d/*.confin name order, so a later-sorting file loses to cloud-init's50-cloud-init.conf(PasswordAuthentication yeson Ubuntu cloud-image VMs).00-makes the hardening win.MaxAuthTries, no forwarding, modern KEX/cipher/MAC lists), merged with consumer overrides.sshd -tbefore the service is reloaded, so a typo cannot lock the host out.system_typeprofiles ofsystem_baseline, so a hypervisor and a container can differ.Scope of what I would send
About 10 files, roughly 200 lines. Generic by construction; what I would strip before sending: references to my hosts and issue numbers in comments, the coupling to
ansible_user, and a profile name that only makes sense in my inventory. Role vars would besshd_-prefixed, typed inargument_specs.yml, with a molecule scenario on both Ubuntu images.Questions for the maintainer
sshd_settingsmapping that consumers override?sshd role will first be migrated from my repo, see README
Understood, and thanks for saying so before any code landed. I will not open a PR for this.
For reference only: I had already prepared a local, unpushed
sshdrole branch (a drop-in named00-so it sorts before cloud-init's50-cloud-init.conf, a settings mapping merged over defaults,sshd -tbefore the reload with restore on failure, validation that refusesMatch/Include, and a Molecule scenario that has not run). If it helps your migration, say so and I will share it (as a branch or a diff); otherwise it stays local and I will delete it once your role lands. I would be glad to review your version instead.Assisted-by: Claude Code
Labelled Reviewed/Duplicate and withdrawn by the proposer, but still Status/Ready for Human. Recommend the maintainer closes it. (From Order of the implementation backlog, #198.)
Review of the map (2026-11-15): corrections to this issue.
sshdrole has merged and shipped in release 1.6.0 (roles/sshd/;CHANGELOG.rst:13, "Adds the sshd role"). The labels still contradict each other:Reviewed/Duplicatesays nothing is left to do,Status/Ready for Humansays the maintainer has an action. The maintainer can close this issue as completed by thesshdrole; the proposer has offered to review that version instead.@Dragonish pls check whether there sre things you added in your repo that we should migrate here.