Changeset - 6cdeaac2f5a3
[Not reviewed]
0 1 0
x - 20 months ago 2023-08-24 01:46:12
xbr@c3l.lu
fix: remove configured settings in sshd_config
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
initial_server_setup/initial_setup.yml
Show inline comments
 
@@ -57,6 +57,10 @@
 
        content: |
 
          # {{ ansible_managed }}
 
          PasswordAuthentication no
 
      ansible.builtin.lineinfile:
 
        path: /etc/ssh/sshd_config
 
        regex: "^PasswordAuthentication"
 
        line: "# PasswordAuthentication No"
 
      tags: network,ssh
 
    - name: Disable SSH Empty Password
 
      ansible.builtin.copy:
 
@@ -66,6 +70,10 @@
 
        content: |
 
          # {{ ansible_managed }}
 
          PermitEmptyPasswords no
 
      ansible.builtin.lineinfile:
 
        path: /etc/ssh/sshd_config
 
        regex: "^PermitEmptyPasswords"
 
        line: "# PermitEmptyPasswords No"
 
      tags: network,ssh
 
    - name: Disable SSH Root Login
 
      ansible.builtin.copy:
 
@@ -75,6 +83,10 @@
 
        content: |
 
          # {{ ansible_managed }}
 
          PermitRootLogin no
 
      ansible.builtin.lineinfile:
 
        path: /etc/ssh/sshd_config
 
        regex: "^PermitRootLogin"
 
        line: "# PermitRootLogin No"
 
      tags: network,ssh
 
    - name: Reload SSHD
 
      ansible.builtin.service:
0 comments (0 inline, 0 general)