Skip to content

feat(roles/sshd)!: make MaxStartups configurable, default to 10:30:60 - #745

Merged
markuslf merged 1 commit into
mainfrom
feat/sshd-max-startups
Nov 13, 2026
Merged

markuslf merged 1 commit into
mainfrom
feat/sshd-max-startups

Conversation

@markuslf

Copy link
Copy Markdown
Member

Closes #723

What changes

  • sshd__max_startups__host_var / sshd__max_startups__group_var (combined variable) set MaxStartups in all nine sshd_config templates.
  • The default is 10:30:60 instead of the OpenSSH default 10:30:100, as the CIS Benchmarks require. This is a breaking change and listed as such in the CHANGELOG.
  • The role aborts before it replaces sshd_config if the value is not a number or start:rate:full with start <= full and a rate between 1 and 100, the conditions servconf.c checks.
  • sshd uses the first value it reads, so a MaxStartups in sshd__raw no longer takes effect. README and CHANGELOG say so.
  • The gitlab_ce README recommends sshd__max_startups__group_var: '100:30:200' for GitLab hosts, the value GitLab's Git troubleshooting documentation suggests. It is set in the inventory, not injected by playbooks/gitlab_ce.yml, so setup_basic and sshd runs do not reset it.

Deviation from the issue

The issue says the CIS impact section allows raising the value. The CIS Benchmarks for Rocky Linux 9 (v2.0.0) and Rocky Linux 10 (v1.0.0) have no impact section for this recommendation, they ask for 10:30:60 or more restrictive. The README therefore only recommends raising the value on hosts with many legitimate logins and does not claim CIS covers it.

Testing

New Molecule scenario sshd: asks sshd -T for the effective maxstartups, with a group and a host variable set so the host variable has to win, and checks that the daemon unit runs and is enabled. molecule test --scenario-name sshd passes on Debian 12 and 13, Rocky 8, 9 and 10, Ubuntu 22.04, 24.04 and 26.04 (converge, verify, idempotence, verify). pre-commit and ansible-lint pass.

…fix #723)

sshd uses the first value it reads, so a MaxStartups in sshd__raw
no longer takes effect. Verified with the new sshd Molecule scenario
on Debian 12/13, Rocky 8/9/10 and Ubuntu 22.04/24.04/26.04.
@markuslf
markuslf merged commit d63c363 into main Nov 13, 2026
11 checks passed
@markuslf
markuslf deleted the feat/sshd-max-startups branch November 13, 2026 08:56
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.

sshd: make MaxStartups configurable

1 participant