Run jenkins job as another user

|▌冷眼眸甩不掉的悲伤 提交于 2020-05-13 08:10:55

问题


I Installed jenkins using a guide, and that guide created a "jenkins" user in the server and apparently runs the jenkins server under it.

All my setup on the server (virtual env, python package installations) is for a different user ("ci-user"). Is there any way for me to run my jobs as "ci_user" instead of as "jenkins"? I'd like to avoid doing all the setup again for the "jenkins" user.


回答1:


There is JENKINS_USER variable in etc/default/jenkins file. You could change it to ci_user, then you will need to change the ownership of several folders and reboot the machine.

chown -R ci_user /var/lib/jenkins
chown -R ci_user /var/log/jenkins
chown -R ci_user /var/cache/jenkins

Reference



来源:https://stackoverflow.com/questions/49634565/run-jenkins-job-as-another-user

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!