I need that a new user could execute sudo without any request of password, because this user has in crontab a .sh that uses sudo for some commands.
I created a new user on my ubuntu server 16.04 x64
adduser my-user sudo
gpasswd -a my-user sudo
Then using visuo i added this line, based on this question
my-user ALL=(ALL) NOPASSWD : ALL
Then rebooted
After reboot I logged in using my-user and tried to do sudo clear, but it ask me the sudo password.
NOTE: I've added the crontab using crontab -e my-user so I suppose my script is executed as my-user. In fact, the crontabbed script crashes telling me in the log about a sudo request of password. I really need to execute the script in this way to be able to create file with my-suer as owner.
Please tell me if some steps/lines were not needed and how to make able my-user to execute sudo without password request.
Thanks
PS: I seen this question, but I'm not able to make it working so I need a more precise explanation, because my situation is different: i'm running a crontab script and I need it do not ask for sudo password