feat(ssh): allow configuring MaxStartups

This commit is contained in:
Lars Kaiser 2024-02-29 15:22:53 +01:00
parent f204f3036b
commit b4c259dd1d
No known key found for this signature in database
GPG key ID: BB97304A16BC5DCF

View file

@ -66,6 +66,24 @@
notify: "reload sshd"
tags: ["prepare", "prepare-sshd"]
- name: "Set maximum number of concurrent unauthenticated connections"
ansible.builtin.lineinfile:
<<: *sshd_config_args
regexp: "^#?MaxStartups"
line: "MaxStartups {{ sshd_config_max_startups }}"
when: "sshd_config_max_startups is defined"
notify: "reload sshd"
tags: ["prepare", "prepare-sshd"]
- name: "Unset maximum number of concurrent unauthenticated connections"
ansible.builtin.lineinfile:
<<: *sshd_config_args
regexp: "^#?MaxStartups"
line: "#MaxStartups 10:30:100"
when: "sshd_config_max_startups is not defined"
notify: "reload sshd"
tags: ["prepare", "prepare-sshd"]
- name: "Only allow SSHv2"
ansible.builtin.lineinfile:
<<: *sshd_config_args