Enable passwordless sudo as a specific user

Follow these steps:

  1. Edit sudoers file (this can be present in /etc/sudoers.d/file_name)
sudo visudo -f /etc/sudoers
  1. Add line at the end of the file
usernameusedforlogin ALL=(ALL) NOPASSWD:ALL
  1. 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 admingroup definitions, or place it in separate file in /etc/sudoers.d/.

Tags:

Sudo