From 1ff6340e743164abca94c7359da484628e8904c7 Mon Sep 17 00:00:00 2001 From: Ben Hays Date: Sun, 26 Nov 2023 15:36:02 -0500 Subject: [PATCH] Update Inventory and OpenSSH Playbook --- Ansible/inventory.ini | 4 ++-- Ansible/openssh.yml | 20 ++++++++++++++++++++ Configs/sshd_config | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Ansible/inventory.ini b/Ansible/inventory.ini index 18afda1..390d1db 100644 --- a/Ansible/inventory.ini +++ b/Ansible/inventory.ini @@ -8,6 +8,6 @@ [linux] 10.0.1.2 10.0.1.12 +10.0.1.13 10.0.1.14 -10.0.1.15 -10.0.1.16 \ No newline at end of file +10.0.1.15 \ No newline at end of file diff --git a/Ansible/openssh.yml b/Ansible/openssh.yml index 8e876da..26f54e4 100644 --- a/Ansible/openssh.yml +++ b/Ansible/openssh.yml @@ -1,11 +1,31 @@ - hosts: linux remote_user: root + become: true + become_user: root tasks: - name: Update/install OpenSSH apt: name: openssh-server state: latest update_cache: yes + - name: Add 'bhays' user + user: + name: bhays + groups: sudo + append: yes + comment: Benjamin Hays + - name: Update/install Sudo + apt: + name: sudo + state: latest + - name: Ensure .ssh user folder exists + file: + path: "/home/bhays/.ssh/" + state: directory + - name: Copy public key + copy: + src: ~/.ssh/authorized_keys + dest: /home/bhays/.ssh/authorized_keys - name: Copy Secure Configuration File copy: src: ../Configs/sshd_config diff --git a/Configs/sshd_config b/Configs/sshd_config index 8a076f2..6a1e0ac 100644 --- a/Configs/sshd_config +++ b/Configs/sshd_config @@ -13,7 +13,7 @@ MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@op LogLevel VERBOSE #LoginGraceTime 2m -#PermitRootLogin prohibit-password +PermitRootLogin yes #StrictModes yes MaxAuthTries 5 MaxSessions 8