From 248332c3aa9ba0814bbe6a44a9675d390e2f4a95 Mon Sep 17 00:00:00 2001 From: Brian Lee Date: Fri, 14 Jul 2023 10:12:06 -0700 Subject: [PATCH] Include file utility, and prefer ed25519 ssh keys. --- tasks/main.yml | 12 ++++++++++++ vars/Debian.yml | 1 + 2 files changed, 13 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index e86460f..09cffef 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,3 +20,15 @@ ansible.builtin.package: state: present name: "{{ sysadmin_packages }}" + +- name: Generate ed25519 SSH host key + ansible.builtin.command: + cmd: ssh-keygen -A + creates: /etc/ssh/ssh_host_ed25519_key + +- name: Prefer ed25519 HostKeys in sshd_config + ansible.builtin.lineinfile: + path: /etc/ssh/sshd_config + regex: 'HostKey /etc/ssh/ssh_host_ed25519_key' + line: 'HostKey /etc/ssh/ssh_host_ed25519_key' + state: present \ No newline at end of file diff --git a/vars/Debian.yml b/vars/Debian.yml index 1c26c61..7938451 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -1,6 +1,7 @@ --- sysadmin_packages: - curl + - file - dnsutils - git - gpg