I am trying to compile some sources using a makefile. In the makefile there is a bunch of commands that need to be ran as sudo
.
When I compile the sour
In Jenkins:
echo '<your-password>' | sudo -S command
Eg:-
echo '******' | sudo -S service nginx restart
You can use Mask Password Plugin to hide your password
I think I can help someone with my case.
First, I changed the user setting in /etc/sudoers
referring to above answer. But It still didn't work.
myuser ALL=(ALL) NOPASSWD: ALL
%mygroup ALL=(ALL:ALL) ALL
In my case, myuser
was in the mygroup
.
And I didn't need groups. So, deleted that line.
(Shouldn't delete that line like me, just marking the comment.)
myuser ALL=(ALL) NOPASSWD: ALL
It works!