Skip to content

Commit

Permalink
stop users from using 'su'
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Jan 16, 2024
1 parent 4a28106 commit 595e1a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infrastructure/server-setup/tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
state: '{{ item.state }}'
with_items: '{{ users }}'

- name: Grant passwordless sudo to the users
- name: Grant passwordless sudo to the users, but prevent usage of 'su'
ansible.builtin.lineinfile:
path: /etc/sudoers.d/{{ item.name }}
line: '{{ item.name }} ALL=(ALL) NOPASSWD:ALL'
line: '{{ item.name }} ALL=(ALL) NOPASSWD:ALL, !/usr/bin/su'
validate: 'visudo -cf %s'
create: yes
become: yes
Expand Down

0 comments on commit 595e1a2

Please sign in to comment.