first commit

This commit is contained in:
2026-02-16 17:41:03 +00:00
commit 3f15490a0d
1055 changed files with 194272 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
---
- name: Disable root and password SSH login
hosts: all
become: true
gather_facts: true
tasks:
- name: Ensure PermitRootLogin is disabled
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^PermitRootLogin'
line: 'PermitRootLogin no'
state: present
- name: Disable password authentication
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^PasswordAuthentication'
line: 'PasswordAuthentication no'
state: present
- name: Disable challenge response authentication
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^ChallengeResponseAuthentication'
line: 'ChallengeResponseAuthentication no'
state: present
- name: Ensure PubkeyAuthentication enabled
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^PubkeyAuthentication'
line: 'PubkeyAuthentication yes'
state: present
- name: Restart SSH
ansible.builtin.service:
name: ssh
state: restarted