e089818d51
* bootstrap rolle bugfix: https://github.com/robertdebock/ansible-role-bootstrap/issues/43 * on-off Playbook - delete_ssh * KeepassDB in git aufgenommen * Variable wird nicht mehr genutzt
26 lines
733 B
YAML
26 lines
733 B
YAML
---
|
|
- hosts: all
|
|
tasks:
|
|
- name: delete /home/mg/.ssh/authorized_keys
|
|
become: yes
|
|
ansible.builtin.file:
|
|
name: /home/mg/.ssh/authorized_keys
|
|
state: absent
|
|
- name: delete /home/ansible-user/.ssh/authorized_keys
|
|
become: yes
|
|
ansible.builtin.file:
|
|
name: /home/ansible-user/.ssh/authorized_keys
|
|
state: absent
|
|
- name: prohibit ssh login with password
|
|
become: yes
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/ssh/sshd_config
|
|
regexp: 'PasswordAuthentication no'
|
|
line: 'PasswordAuthentication yes'
|
|
state: present
|
|
- name: restart_sshd
|
|
become: yes
|
|
systemd:
|
|
name: sshd
|
|
enabled: yes
|
|
state: restarted
|