Cannot su for jenkins users after installing jenkins

I installed jenkins and I'm trying to get into the shell like Jenkins to add the ssh key. I can't imagine jenkins user:

[root@pacmandev /]# sudo su jenkins [root@pacmandev /]# whoami root [root@pacmandev /]# echo $USER root [root@pacmandev /]# 

User jenkins exists in my / etc / passwd file. Runnin su jenkins asks for a password, but rejects my regular password. sudo su jenkins doesn't seem to be doing anything; same for sudo su - jenkins . I'm on CentOS.

+82
linux unix continuous-integration jenkins
Aug 05
source share
4 answers

jenkins is a service account, it does not have a design shell. It is generally recognized that service accounts should not be registered online.

At first I did not answer this question, since this is a duplicate of the question that was ported to a server error . I had to answer, and was not connected with the answer in the comment.

if for some reason you want to log in as jenkins, you can do it with: sudo su -s /bin/bash jenkins

+205
Aug 6 '13 at 13:03
source share
 su - jenkins -s/bin/bash whoami jenkins 
0
Jun 12 '19 at 6:42
source share

If you use Jenkins inside the docker. Then you should try the following.

  • First you need to run the jenkins container " Docker start (container-name or container-id)"

  • Then run this command "docker exec -it (container name or container identifier) ​​bash"

Now, I hope you will use jenkins as a user.

-one
Nov 16 '18 at 6:55
source share

as root, enter su-jenkins

Also, check in / etc / passwd that the jenkins user is allowed to log in: there must be something like / bin / bash or / bin / sh, of course there is no / bin / false at the end of the line.

Hint: You are not using su and sudo at the same time.

-10
Aug 06 '13 at 8:35
source share



All Articles