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

From wikieduonline
Jump to navigation Jump to search
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
 +
* <code>[[visudo]]</code>
 +
* <code>[[/etc/sudoers]]</code>
 +
* <code>[[/etc/sudoers.d/]]</code>
  
 +
* Ansible: [[Configure user to be able to use sudo with no password]] using <code>[[lineinfile]]</code> module
  
 +
== Activities ==
 +
* Understand order rules are applied and impact: https://vim.fandom.com/wiki/Set_Vim_as_your_default_editor_for_Unix
 +
* <code>[[usermod -aG sudo]] USERNAME</code>
  
== Passwordless sudo using [[DevOps/Ansible|Ansible]] ==
+
== Related ==
<pre>
+
* [[NOPASSWD]]
#!/usr/bin/env ansible-playbook
+
* %sudo ALL=(ALL) NOPASSWD: ALL
 
+
* [[Passkey]]
- hosts: YOUR_MACHINE
 
  tasks:
 
    - lineinfile:
 
        path: /etc/sudoers
 
        state: present
 
        regexp: '^%sudo'
 
        line: '%sudo ALL=(ALL) NOPASSWD: ALL'
 
        validate: 'visudo -cf %s'
 
</pre>
 
 
 
  
 
== See also ==
 
== See also ==
* <code>[[useradd]]</code>
+
* {{sudo}}
* [[DevOps/Ansible/Configure user to be able to use sudo with no password]]
 
* [[DevOps/Ansible|Ansible]]
 
  
 
[[Category:Linux]]
 
[[Category:Linux]]
 +
[[Category:sudo]]

Revision as of 10:42, 21 December 2023

Advertising: