ansible-common/tasks/ssh.yml
Frank Villaro-Dixon a12c502c85 vim + ssh
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-10-13 01:08:56 +02:00

21 lines
No EOL
515 B
YAML

- 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
- name: Ensure ssh service is started and enabled
systemd:
name: ssh
enabled: yes
state: started
when: ansible_os_family == 'Debian'
- name: Ensure sshd service is started and enabled
systemd:
name: sshd
enabled: yes
state: started
when: ansible_os_family == 'Archlinux'