Changeset - 6cdeaac2f5a3
[Not reviewed]
0 1 0
x - 21 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
 
@@ -48,42 +48,54 @@
 
        state: present
 
      tags: network,hostname,dns
 

	
 
    # SSH security improvements (EmptyPass, PassAuth, RootLogin)
 
    - name: Disable SSH Password Auth
 
      ansible.builtin.copy:
 
        dest: /etc/ssh/sshd_config.d/disable_password_auth.conf
 
        owner: root
 
        mode: u=rw,g=r,o=r
 
        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:
 
        dest: /etc/ssh/sshd_config.d/disable_empty_password.conf
 
        owner: root
 
        mode: u=rw,g=r,o=r
 
        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:
 
        dest: /etc/ssh/sshd_config.d/disable_root_login.conf
 
        owner: root
 
        mode: u=rw,g=r,o=r
 
        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:
 
        name: "sshd"
 
        state: "reloaded"
 
      tags: network,ssh
 

	
 
    # Create Freifunk Users
 
    - name: Create member users
 
      ansible.builtin.user:
 
        name: "{{ item.username }}"
 
        password: "{{ password | password_hash('sha512') }}"
0 comments (0 inline, 0 general)