Run Jenkins jobs on Linux under a User

后端 未结 3 1485
醉梦人生
醉梦人生 2021-01-01 12:41

I have Jenkins installed in Linux and I want to run the build(s) under a user.

Not just a simple user, but one that belongs to the list of user that access the linux

相关标签:
3条回答
  • 2021-01-01 13:26

    Yes, it is necessary to set JENKINS_USER variable, but in another file.

    Look here http://blog.manula.org/2013/03/running-jenkins-under-different-user-in.html

    0 讨论(0)
  • 2021-01-01 13:28

    Have a look at the Started-By Environment Variable plugin.

    https://wiki.jenkins-ci.org/display/JENKINS/Started-By+Environment+Variable+Plugin

    EDIT:

    If you are just asking how to set up Jenkins to run under a different user in Linux it depends on how you installed it. I never set up Jenkins on Linux yet (but I can use google). Have a look at https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins for different setup options. I had a look at Installing Jenkins as a Unix daemon and at step 7 you need to setup a configuration file. Change the last line in that file (RUN_AS_USER=jenkins) to contain the user of your choice.

    0 讨论(0)
  • 2021-01-01 13:47

    There is nothing only the root user could do that you cant do in a proper way, by creating a dedicated user for your task with proper rights on the concerned files or binaries. Give example of the task you want to do as root if you need more accurate example.

    0 讨论(0)
提交回复
热议问题