问题
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
回答1:
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?
来源:https://stackoverflow.com/questions/11841140/how-to-run-jenkins-as-super-user