Difference between revisions of "Enable passwordless sudo for a specific user"

From wikieduonline
Jump to navigation Jump to search
(Created page with " == Passwordless sudo using Ansible == <pre> #!/usr/bin/env ansible-playbook - hosts: YOUR_MACHINE tasks: - lineinfile: path: /etc/sudoers...")
 
Line 19: Line 19:
  
 
== See also ==
 
== See also ==
* [[useradd]]
+
* <code>[[useradd]]</code>
 
* [[DevOps/Ansible/Configure user to be able to use sudo with no password]]
 
* [[DevOps/Ansible/Configure user to be able to use sudo with no password]]
 
* [[DevOps/Ansible|Ansible]]
 
* [[DevOps/Ansible|Ansible]]
  
 
[[Category:Linux]]
 
[[Category:Linux]]

Revision as of 11:00, 11 December 2019



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'


See also

Advertising: