2024-10-04 16:52:39 +00:00
|
|
|
- name: Enable SSH root login in sshd_config
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/ssh/sshd_config
|
|
|
|
regexp: '^#?PermitRootLogin'
|
|
|
|
line: 'PermitRootLogin prohibit-password'
|
|
|
|
state: present
|
|
|
|
notify: restart sshd
|
|
|
|
|
2024-10-04 21:05:14 +00:00
|
|
|
- name: Ensure ssh service is started and enabled
|
|
|
|
systemd:
|
|
|
|
name: ssh
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
2024-10-04 16:52:39 +00:00
|
|
|
- name: Ensure sshd service is started and enabled
|
|
|
|
systemd:
|
|
|
|
name: sshd
|
|
|
|
enabled: yes
|
2024-10-04 21:05:14 +00:00
|
|
|
state: started
|
|
|
|
when: ansible_os_family == 'Archlinux'
|