Sunday, December 2, 2018

How to change jenkins background OS user on Ubuntu

To change the jenkins user, open the /etc/sysconfig/jenkins (in debian this file is created in /etc/default) and change the JENKINS_USER to whatever you want. 


Make sure that user exists in the system (you can check the user in the /etc/passwd file ).

$JENKINS_USER="user1"


Then change the ownership of the Jenkins home, Jenkins webroot and logs.
chown -R user1:user1 /var/lib/jenkins 
chown -R user1:user1 /var/cache/jenkins
chown -R user1:user1 /var/log/jenkins


Then restart the Jenkins and check the user has changed using a ps command 


/etc/init.d/jenkins restart
ps -ef | grep jenkins

Reference

No comments:

Post a Comment