Search code examples
jenkins

How to run jenkins's job as a specific user?


Jenkins cluster in my company runs builds as root user. How to configure cluster/build to run as a different user? Without root privileges ?


Solution

  • Builds always run under the user that runs the node agent process. So your options are

    • Specify a different user for connecting the node, or
    • Switch to a different user during the build (e.g., via sudo in a shell build step). This is more flexible, but plugin related-code (like SCM checkout) will still run under the root account.