From febea4cf6cf4365d0d0b6f7f0117048ffdf69be9 Mon Sep 17 00:00:00 2001 From: OldTyT Date: Sat, 1 Jun 2024 13:25:29 +0000 Subject: [PATCH] feat: added set i attr in authorized_keys file --- tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index cc73c4d..9ecbe9b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,10 +1,20 @@ --- +- name: Delete i attr from authorized_keys file + ansible.builtin.file: + path: /root/.ssh/authorized_keys + attr: '-i' + - name: Write ssh keys template: src: "authorized_keys.j2" dest: "/root/.ssh/authorized_keys" mode: 0600 +- name: Set i attr from authorized_keys file + ansible.builtin.file: + path: /root/.ssh/authorized_keys + attr: 'i' + - name: Authentication method public key only lineinfile: path: /etc/ssh/sshd_config