vm-ansible/roles/common/tasks/ssh-security-settings.yaml

25 lines
527 B
YAML
Raw Normal View History

---
- name: Disable root authentication
2023-08-30 23:13:59 +02:00
replace:
path: /etc/ssh/sshd_config
regexp: '#PermitRootLogin prohibit-password'
replace: 'PermitRootLogin no'
- name: Disable X11 forwarding
2023-08-30 23:13:59 +02:00
replace:
path: /etc/ssh/sshd_config
regexp: 'X11Forwarding yes'
replace: 'X11Forwarding no'
- name: Explicitly only listen on ipv4
2023-08-30 23:13:59 +02:00
replace:
path: /etc/ssh/sshd_config
regexp: '#AddressFamily any'
replace: 'AddressFamily inet'
2022-04-16 21:03:00 +02:00
- name: "Restart sshd"
2023-08-30 23:13:59 +02:00
service:
2022-04-16 21:03:00 +02:00
name: sshd
2022-04-16 21:05:42 +02:00
state: restarted
2022-04-16 19:55:29 +02:00
...