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,394 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,391 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
5,027 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
5,028 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
4,062 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