Allow passwordless sudo for ssh login user
This commit is contained in:
@@ -26,6 +26,13 @@
|
|||||||
append: yes
|
append: yes
|
||||||
groups:
|
groups:
|
||||||
- sudo
|
- sudo
|
||||||
|
- name: allow passwordless sudo for new user
|
||||||
|
template:
|
||||||
|
src: etc/sudoers.d/ssh_user.j2
|
||||||
|
dest: /etc/sudoers.d/{{ ssh_user }}
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0440
|
||||||
- name: add authorized key to SSH login user
|
- name: add authorized key to SSH login user
|
||||||
authorized_key:
|
authorized_key:
|
||||||
key: "{{ item }}"
|
key: "{{ item }}"
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
{{ ssh_user }} ALL=(ALL) NOPASSWD:ALL
|
||||||
Reference in New Issue
Block a user