Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to become a Jenkins user?

I have installed Jenkins and during installation an user named jenkins has been created. I can see from the documentation:

The 'jenkins' user is created to run this service.

Now I need to become this jenkins user. I have in the following ways:

[root@hostname ~]# sudo su - jenkins
[root@hostname ~]# id
uid=0(root) gid=0(root) groups=0(root)

[root@hostname tmp]# su - jenkins
[root@hostname tmp]# whoami
root

Why switch user to the jenkins user is not working?

I am on RHEL.

cat /etc/*release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
like image 371
Exploring Avatar asked Jan 29 '14 14:01

Exploring


People also ask

What is a Jenkins user?

Jenkins users can be “Admin” users or “system” users. The Jenkins Admin users have a user id and can be used for login. The Jenkins admin users usually have authenticated to do all of the critical configuration settings related to Jenkins.


1 Answers

It's more like a queastion for superuser but:

You don't need sudo when switching the user. su will ask for the users password anyway:

su - jenkins

You can also use sudo to execute a single command as another user with the -u option. If that command is a shell, you'll get a shell. E.g.:

sudo -u jenkins /bin/bash
like image 88
André Stannek Avatar answered Oct 22 '22 13:10

André Stannek