Add more configuration restrictions

This commit is contained in:
Alexander Gorelyshev
2026-06-08 12:19:08 +04:00
parent d62db95075
commit 310bda74af

View File

@@ -7,6 +7,11 @@
- { regexp: '^#?IgnoreRhosts', line: 'IgnoreRhosts yes' } - { regexp: '^#?IgnoreRhosts', line: 'IgnoreRhosts yes' }
- { regexp: '^#?DebianBanner\s+', line: 'DebianBanner no' } - { regexp: '^#?DebianBanner\s+', line: 'DebianBanner no' }
notify: Restart sshd notify: Restart sshd
- { regexp: '^#?\s*KbdInteractiveAuthentication\s+', line: 'KbdInteractiveAuthentication no' }
- { regexp: '^#?\s*HostbasedAuthentication\s+', line: 'HostbasedAuthentication no' }
- { regexp: '^#?\s*PermitUserEnvironment\s+', line: 'PermitUserEnvironment no' }
- { regexp: '^#?\s*StrictModes\s+', line: 'StrictModes yes' }
- { regexp: '^#?\s*IgnoreUserKnownHosts\s+', line: 'IgnoreUserKnownHosts yes' }
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"