mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
feat(ssh): allow configuring MaxSessions
This commit is contained in:
parent
b8af3d57f1
commit
f204f3036b
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue