Enable passwordless sudo for a specific user

From wikieduonline
Revision as of 08:25, 19 August 2020 by Welcome (talk | contribs)
Jump to navigation Jump to search



Passwordless sudo using Ansible

#!/usr/bin/env ansible-playbook

- hosts: YOUR_MACHINE
  tasks:
    - lineinfile:
        path: /etc/sudoers
        state: present
        regexp: '^%sudo'
        line: '%sudo ALL=(ALL) NOPASSWD: ALL'
        validate: 'visudo -cf %s'


Activities

See also

Advertising: