A
A
AlexRas2018-08-03 12:00:33
Jenkins
AlexRas, 2018-08-03 12:00:33

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

2 answer(s)
A
AlexRas, 2018-08-03
@AlexRas

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

D
Dmitry Shitskov, 2018-08-03
@Zarom

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 question

Ask a Question

731 491 924 answers to any question