feat(ssh): allow configuring MaxSessions

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

View file

@ -48,6 +48,24 @@
notify: "reload sshd"
tags: ["prepare", "prepare-sshd"]
- name: "Set maximum number of open sessions permitted per network connection"
ansible.builtin.lineinfile:
<<: *sshd_config_args
regexp: "^#?MaxSessions"
line: "MaxSessions {{ sshd_config_max_sessions }}"
when: "sshd_config_max_sessions is defined"
notify: "reload sshd"
tags: ["prepare", "prepare-sshd"]
- name: "Unset maximum number of open sessions permitted per network connection"
ansible.builtin.lineinfile:
<<: *sshd_config_args
regexp: "^#?MaxSessions"
line: "#MaxSessions 10"
when: "sshd_config_max_sessions is not defined"
notify: "reload sshd"
tags: ["prepare", "prepare-sshd"]
- name: "Only allow SSHv2"
ansible.builtin.lineinfile:
<<: *sshd_config_args