I have an Ubuntu 22.04 LTS VM that I want to give password-less sudo to a specific user
I created /etc/sudoers.d/user with the content
user ALL=(ALL:ALL) NOPASSWD:ALL
The user is also on the sudo group so
sudo -l
gives both
(ALL : ALL) ALL
(ALL : ALL) NOPASSWD: ALL
Reading this answer, the NOPASSWD should have worked because it is in /etc/sudoers.d/ but it doesn't, password is still asked
sudoers read :
# Host alias specification
User alias specification
Cmnd alias specification
User privilege specification
root ALL=(ALL:ALL) ALL
Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
See sudoers(5) for more information on "@include" directives:
@includedir /etc/sudoers.d