I have added jenkins as a sudo user in my build node:

$ sudo usermod -aG sudo jenkins

This also works on the build node. However, in my build log there is:

[sudo] password for jenkins: jenkins is not in the sudoers file.  This incident will be reported.

What could cause this?

I was trying run echo ${PASSWORD} | sudo -S make install on the build node.

  • I'm assuming that you are not "jenkins"? To add a user to the 'sudo' group, you need to be in the sudo group already. If you are running as user "jenkins" and "jenkins" does not have sudo privileges, then a user with those privileges needs to add "jenkins" to the group. – Charles Green Mar 6 at 14:51
  • Yes, I'm not jenkins. – user205301 Mar 6 at 16:06

The solution was simple: reboot.

  • I was just going to suggest that! – Charles Green Mar 6 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.