Jenkins - ftsrg/cheat-sheets GitHub Wiki

Allow sudo for Jenkins

sudo su    
visudo -f /etc/sudoers

add add following line at the end.

jenkins ALL= NOPASSWD: ALL

You can also specify what scripts can Jenkins run as sudo:

jenkins ALL = NOPASSWD: /home/user/deploy.sh
⚠️ **GitHub.com Fallback** ⚠️