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

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 21: Line 21:
 
* Understand order rules are applied and impact: https://vim.fandom.com/wiki/Set_Vim_as_your_default_editor_for_Unix
 
* Understand order rules are applied and impact: https://vim.fandom.com/wiki/Set_Vim_as_your_default_editor_for_Unix
 
* <code>sudo update-alternatives --config editor</code>
 
* <code>sudo update-alternatives --config editor</code>
* <code>[[usermod]] -aG sudo</code>
+
* <code>[[usermod]] -aG sudo USERNAME</code>
  
 
== See also ==
 
== See also ==

Revision as of 08:24, 19 August 2020



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: