summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks/ssh.yml
blob: 9be8d3147f239630d4b868ec3cc5156a4925f408 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
- name: Accès uniquement par clé ssh
  lineinfile:
    dest: /etc/ssh/sshd_config
    state: present
    backrefs: yes
    regexp: "^PasswordAuthentication yes"
    line: "PasswordAuthentication no"
  notify: restart sshd

- name: Décommenter option par défaut
  lineinfile:
    dest: /etc/ssh/sshd_config
    state: present
    backrefs: yes
    regexp: "^#PermitRootLogin yes"
    line: "PermitRootLogin yes"
  notify: restart sshd

- name: Ouverture du port ssh secondaire
  firewalld:
    port: "54444/tcp"
    permanent: yes
    immediate: yes
    state: enabled