vm-ansible/roles/common/tasks/ssh-security-settings.yaml
Kristóf Torma 8887c47c2c
Some checks failed
continuous-integration/drone/push Build is failing
update everything to be ad compatible
2023-07-25 16:58:19 +02:00

25 lines
591 B
YAML

---
- name: Disable root authentication
ansible.builtin.replace:
path: /etc/ssh/sshd_config
regexp: '#PermitRootLogin prohibit-password'
replace: 'PermitRootLogin no'
- name: Disable X11 forwarding
ansible.builtin.replace:
path: /etc/ssh/sshd_config
regexp: 'X11Forwarding yes'
replace: 'X11Forwarding no'
- name: Explicitly only listen on ipv4
ansible.builtin.replace:
path: /etc/ssh/sshd_config
regexp: '#AddressFamily any'
replace: 'AddressFamily inet'
- name: "Restart sshd"
ansible.builtin.service:
name: sshd
state: restarted
...