diff --git a/ansible/requirements/ansible-galaxy.yml b/ansible/requirements/ansible-galaxy.yml index 997d7a83..730768b8 100644 --- a/ansible/requirements/ansible-galaxy.yml +++ b/ansible/requirements/ansible-galaxy.yml @@ -1,6 +1,4 @@ roles: - - src: willshersystems.sshd - version: v0.25.0 - src: nginxinc.nginx version: 0.24.3 - src: geerlingguy.certbot @@ -18,4 +16,4 @@ roles: version: 7.4.7 collections: - name: community.docker # manages containers - version: 4.6.1 \ No newline at end of file + version: 4.6.1 diff --git a/ansible/roles/ssh_users/tasks/main.yml b/ansible/roles/ssh_users/tasks/main.yml index 6ab0e805..3615a9ba 100644 --- a/ansible/roles/ssh_users/tasks/main.yml +++ b/ansible/roles/ssh_users/tasks/main.yml @@ -52,16 +52,16 @@ mode: 0400 with_items: "{{ admin_usernames | union(non_admin_usernames) }}" -- name: configure sshd +- name: configure sshd_config tags: ssh_users - include_role: - name: willshersystems.sshd - vars: - sshd_skip_defaults: false - sshd: - AllowUsers: "{{ admin_usernames | union(non_admin_usernames) | sort | join(' ') }}" + template: + src: sshd_config + dest: /etc/ssh/sshd_config + owner: root + group: root + mode: 0440 -- name: Enesure sudoers dir exists +- name: Ensure sudoers dir exists tags: ssh_users ansible.builtin.file: path: /etc/sudoers.d diff --git a/ansible/roles/ssh_users/templates/allow_users b/ansible/roles/ssh_users/templates/allow_users new file mode 100644 index 00000000..e69de29b diff --git a/ansible/roles/ssh_users/templates/sshd_config b/ansible/roles/ssh_users/templates/sshd_config new file mode 100644 index 00000000..6f7b1273 --- /dev/null +++ b/ansible/roles/ssh_users/templates/sshd_config @@ -0,0 +1,12 @@ +Include /etc/ssh/sshd_config.d/*.conf +AllowUsers {{ admin_usernames | union(non_admin_usernames) | sort | join(' ') }} +PasswordAuthentication No +KbdInteractiveAuthentication no +UsePAM yes +X11Forwarding yes +PrintMotd no +AcceptEnv LANG LC_* +Subsystem sftp /usr/lib/openssh/sftp-server +Ciphers chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr +KexAlgorithms mlkem768x25519-sha256,curve25519-sha256 +MACs hmac-sha2-512,hmac-sha2-256