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, 2020 in Jenkins by anonymous
• 19,610 points
36,259 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, 2020 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,680 points
1,342 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
• 59,230 points
4,980 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
• 59,230 points
4,915 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,987 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP