how to run jenkins as super user?
Asked Answered
K

1

-1

I am Mahesh. I installed jenkins in my linux machine,IT works well as a normal user, When i try to run one script in super user [root] mode,It is not working properly,Even i disable the password in sudoers file it is not working and also It not giving any error It just running the script in normal user instead of root ?? what i do? how i can resolve this problem ??

I just add like this in shell script coloumn in jenkins...

sudo su //comment-->I disable the password so no password required ,I tested in the terminal and am able to enter into root without password with this

sh something.sh

Knapsack answered 7/8, 2012 at 7:25 Comment(2)
How did you install Jenkins? Which version? Which Linux distribution are you using? Which version? What does your /etc/sudoers file look like?Stillman
possible duplicate of How to run a script as root in Jenkins?Allogamy
D
5

I would advise against running Jenkins (or any application server) as the root user.

Instead of battling the sudo command, why not install the Jenkins ssh plugin and configure the jenkins user to perform an ssh login to the root account?

Duel answered 7/8, 2012 at 19:20 Comment(2)
this could be a good solution. could you please provide a quick walkthrough? as i've downloaded the plugin, but cannot get it to login to localhost. i've searched and read my ass off : #6314429 f.e. yet i still cannot get it work.Haematosis
Yes, i am. Thanks for coming back to this, i've decided to use the standalone Jenkins app someone made. This seems more logical, then i also not have to have it run allways, as i'm not allways developing anyway :)Haematosis

© 2022 - 2024 — McMap. All rights reserved.