~comcloudway/ansible-ccw.icu

758e7a81454ded42301e416dcada940ee25a5c6d — Jakob Meier 1 year, 1 month ago 85d5299
Relaxed permissions
1 files changed, 10 insertions(+), 1 deletions(-)

M roles/system/tasks/ssh.yml
M roles/system/tasks/ssh.yml => roles/system/tasks/ssh.yml +10 -1
@@ 2,12 2,21 @@
- name: Disable SSH password auth
  ansible.builtin.lineinfile:
    path: /etc/ssh/sshd_config
    regexp: ^#PasswordAuthentication yes
    regexp: ^#?PasswordAuthentication yes
    line: PasswordAuthentication no
    validate: sshd -T -f %s
    mode: "0644"
  notify: Restart sshd

- name:
  ansible.builtin.lineinfile:
    path: /etc/ssh/sshd_config
    regexp: ^#?PermitRootLogin (yes|no)
    line: PermitRootLogin prohibit-password
    validate: sshd -T -f %s
    mode: "0644"
  notify: Restart sshd

- name: Enable ssh on boot
  ansible.builtin.service:
    name: sshd