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

From wikieduonline
Jump to navigation Jump to search
Line 25: Line 25:
 
== See also ==
 
== See also ==
 
* {{sudo}}
 
* {{sudo}}
* <code>[[useradd]]</code>
+
* {{Linux Commands privileges}}
* [[DevOps/Ansible/Configure user to be able to use sudo with no password]]
+
* {{Ansible}}
* [[Ansible]]
 
 
* [[vim]]
 
* [[vim]]
 
* {{OpenSSH}}
 
* {{OpenSSH}}
  
 
[[Category:Linux]]
 
[[Category:Linux]]

Revision as of 12:37, 26 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'


Activities


See also

Advertising: