Answer the question
In order to leave comments, you need to log in
How to change the user under which the console commands are executed in Jenkins?
Hi, I'm getting an access error when trying to build a project. The project has already been built, the project folders and files are owned by the www-root user and group. Jenkins is using the jenkins user and I am getting an error when trying to build.
How to change jenkins user to www-root in Jenkins?
Answer the question
In order to leave comments, you need to log in
For ubuntu, it changes in the /etc/default/jenkens file:
JENKINS_USER="www-root"
JENKINS_GROUP="www-root"
Next, change the user everywhere:
chown -R www-root:www-root /var/lib/jenkins
chown -R www-root:www-root /var/cache/jenkins
chown -R www-root:www-root /var/log/jenkins
And restart jenkins:
service jenkins restart
sudo su - www-root
The jenkins user must have the right to execute this command in sudoers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question