16

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'
  • 1
    adduser jenkins – Ipor Sircer Sep 8 '16 at 14:27
  • @IporSircer Thanks, yes, it looks like there is no jenkins user. – kevlarjacket Sep 8 '16 at 14:34
11

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.

| improve this answer | |
  • 11
    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 '18 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 '18 at 21:58
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
| improve this answer | |
  • Did it resolved your issue? Does creating a jenkins user by yourself is same as the user created by jenkins itself? – reiley Oct 28 '18 at 15:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.