Enable passwordless sudo as a specific user
Follow these steps:
- Edit sudoers file (this can be present in /etc/sudoers.d/file_name)
sudo visudo -f /etc/sudoers
- Add line at the end of the file
usernameusedforlogin ALL=(ALL) NOPASSWD:ALL
- Save file
esc :wq!
Revised answer from comments: If you place directives below #includedir
, they are ignored. Move the line next to the sudo
or admin
group definitions, or place it in separate file in /etc/sudoers.d/
.