24

Specifically, I am trying test something on my build server by switching to the "jenkins" user:

sudo su - jenkins
No passwd entry for user 'jenkins'
2
  • 1
    adduser jenkins Sep 8, 2016 at 14:27
  • @IporSircer Thanks, yes, it looks like there is no jenkins user. Sep 8, 2016 at 14:34

2 Answers 2

17

The error message is pretty much self-explanatory. It says that the user jenkins has no entry in the /etc/passwd file i.e. the user does not exist in the system.

When you do any user related operations that requires username, password, home directory, shell information, the /etc/passwd file is consulted first. No entry in that file leading to the very error you are getting. So you need to create the user first (useradd/adduser). As a side note, unless necessary you should create any service specific user (non-human) e.g. jenkins as system user.

3
  • 24
    I would argue that it is not self-explanatory. The error is about a password and the problem is the non existence of a user. If the error was the user does not exist that would be self-explanatory.
    – YannickSSE
    Jun 6, 2018 at 17:36
  • 1
    @YannickSSE the error message is not about password, it is about passwd which is the traditional database of user accounts on a system (residing in /etc/passwd). On most modern systems, the passwords as such are stored elsewhere - often in /etc/shadow.
    – peterph
    Dec 29, 2018 at 21:58
  • You can force it with su -s /bin/bash jenkins
    – themadmax
    Jul 11, 2023 at 7:04
4

After a quick search for "List all users in Linux", I found this answer and ran the following command:

cut -d: -f1 /etc/passwd

and, As @Ipor Sircer, suggested, this user does not actually exist, and I have to add it with:

adduser jenkins
1
  • Did it resolved your issue? Does creating a jenkins user by yourself is same as the user created by jenkins itself?
    – reiley
    Oct 28, 2018 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .