feat: added set i attr in authorized_keys file

This commit is contained in:
2024-06-01 13:25:29 +00:00
parent 32be2f858d
commit febea4cf6c

View File

@@ -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 - name: Write ssh keys
template: template:
src: "authorized_keys.j2" src: "authorized_keys.j2"
dest: "/root/.ssh/authorized_keys" dest: "/root/.ssh/authorized_keys"
mode: 0600 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 - name: Authentication method public key only
lineinfile: lineinfile:
path: /etc/ssh/sshd_config path: /etc/ssh/sshd_config