Restric SSH, more security.
This commit is contained in:
parent
1b990b8cdb
commit
adb31d1e86
3 changed files with 14 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
|||
key: "{{ item }}"
|
||||
loop: "{{ keys2deploy }}"
|
||||
|
||||
- name: Allow sudo access without password
|
||||
- name: Allow sudo without password for ansible
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/sudoers.d/95-lmn-ansible
|
||||
line: 'ansible ALL=(root) NOPASSWD: ALL'
|
||||
|
@ -18,3 +18,12 @@
|
|||
ansible.builtin.user:
|
||||
name: ansible
|
||||
password_lock: True
|
||||
|
||||
- name: Limit SSH access to user ansible
|
||||
ansible.builtin.blockinfile:
|
||||
dest: /etc/ssh/sshd_config.d/local.conf
|
||||
create: true
|
||||
block: |
|
||||
PasswordAuthentication no
|
||||
AllowUsers ansible
|
||||
notify: Reload sshd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue