From c4edf2407ac11c9c95a8f4787afed420b65a252b Mon Sep 17 00:00:00 2001 From: transatoshi_mw Date: Mon, 11 Aug 2025 18:08:06 -0700 Subject: [PATCH] Add files via upload --- ansible/ssh-softening.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ansible/ssh-softening.yml diff --git a/ansible/ssh-softening.yml b/ansible/ssh-softening.yml new file mode 100644 index 0000000..6dd2513 --- /dev/null +++ b/ansible/ssh-softening.yml @@ -0,0 +1,25 @@ +- hosts: all + remote_user: root + tasks: + + - name: Replace PermitRootLogin + ansible.builtin.replace: + path: /etc/ssh/sshd_config + regexp: 'PermitRootLogin prohibit-password' + replace: 'PermitRootLogin yes' + + - name: Replace PasswordAuthentication + ansible.builtin.replace: + path: /etc/ssh/sshd_config + regexp: 'PasswordAuthentication no' + replace: 'PasswordAuthentication yes' + + - name: Replace PasswordAuthentication + ansible.builtin.replace: + path: /etc/ssh/sshd_config + regexp: '#PasswordAuthentication no' + replace: 'PasswordAuthentication yes' + + - name: Restart SSH + ansible.builtin.shell: + cmd: systemctl restart ssh