Difference between revisions of "Enable passwordless sudo for a specific user"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
Line 13: | Line 13: | ||
state: present | state: present | ||
regexp: '^%sudo' | regexp: '^%sudo' | ||
− | line: '%sudo ALL=(ALL) NOPASSWD: ALL' | + | line: '%sudo ALL=(ALL) [[NOPASSWD]]: ALL' |
validate: '[[visudo]] -cf %s' | validate: '[[visudo]] -cf %s' | ||
− | |||
== Activities == | == Activities == |
Revision as of 11:52, 25 October 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
- Understand order rules are applied and impact: https://vim.fandom.com/wiki/Set_Vim_as_your_default_editor_for_Unix
sudo update-alternatives --config editor
usermod -aG sudo USERNAME
See also
sudo
,visudo
,su, passwd, sudo su
,Passwordless sudo
,/etc/sudoers
,/etc/sudoers.d/
,/etc/sudoers
,sudo --help
sudo
,id
,visudo
,useradd
,userdel
,usermod
,groups
,passwd
,chown
,chmod
,chgrp
,groupadd
,groupdel
, Passwordless sudo, passwd (package),sudo --help
- Ansible: modules, plugins, Playbooks (examples)
ansible-playbook
,ansible-vault
,ansible-inventory
,ansible-config
, Ansible Tower, Ansible Galaxy (Roles) (ansible-galaxy
),ansible-cmdb
,gather facts
,ansible.cfg
,Ansible Molecule
, Ansible collections,register
,template
,--ask-pass
,--ask-become-pass
,remote_user:
,/etc/ansible/hosts
,ansible-doc
,ansible-lint
,.ansible/
,--forks
,--start-at-task
,changelog
,inventory
,Notify:
,ansible HOSTNAME -m ping
,gathering
,/usr/bin/ansible
,ansible -m ping
,ansible.builtin
,hosts: (Ansible)
,set fact:
,when:
,blockinfile:
,become method:
,include:
,git:
, AWX,ansible --help
, Tags, Ansible variables, versions vim, view, set -o vi, ex, .viminfo
- OpenSSH (changelog):
/etc/ssh/sshd_config
|/etc/ssh/ssh_config
|~/.ssh/
|openSSL | sshd logs
|sftp
|scp
|authorized_keys
|ssh-keygen
|ssh-keyscan
|ssh-add
|ssh-agent
|ssh
|Ssh -O stop
|ssh-copy-id
|CheckHostIP
|UseKeychain
, OpenSSF
Advertising: