How can I enable jenkins to execute the shell commands as sudo or root?

0 votes
Hi Everyone!

I need your help to guide me on how I can enable Jenkins to execute the shell commands as sudo or root!

Anyone can help me on this topic?
Oct 23 in Jenkins by anonymous
• 19,570 points
97 views

1 answer to this question.

0 votes

Hey, 

  • Create a freestyle project on Jenkins

  • Use the advanced configuration page to use custom workspace

  • Add the path to your shell script 

  • Under the build step, select "execute shell"

  • Finally, enter the name of your shell script and click on save and execute it

answered Oct 23 by Hana

Related Questions In Jenkins

0 votes
1 answer

How do I pass value from my Fake # script to the host build server (Jenkins)

You can use the EnvInject plugin to pass environment ...READ MORE

answered Jul 11, 2018 in Jenkins by Kalgi
• 2,620 points
384 views
0 votes
2 answers

How can I point Jenkins to another .jenkins home directory?

Here are the options you have: a) Assuming ...READ MORE

answered Aug 7, 2019 in Jenkins by Sirajul
• 58,210 points
1,543 views
0 votes
2 answers
0 votes
3 answers

How can I make Jenkins CI with Git trigger on pushes to master?

To automatically run build on code commit, follow ...READ MORE

answered Aug 7, 2019 in Jenkins by Sirajul
• 58,210 points
1,995 views
0 votes
2 answers

How do I start jenkins as an admin without having the need of entering credentials?

I found a way around: Go to /Users/Username/.jenkins/ Open config.xml and remove ...READ MORE

answered Aug 22, 2018 in Jenkins by DareDev
• 6,870 points
235 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
803 views
+2 votes
1 answer