Leandro Borges Ferreira
Leandro Borges Ferreira

Reputation: 12782

How to create a user in jenkins?

I just installed Jenkins in my machine running Ubuntu.

But when I access http://localhost:8080/ jenkins asks me for my username and password... but I have no idea what they are!

How can I log in Jenkins? (Sorry for the noob question, first time using Jenkins)

Any help is welcome!

Edit: So far I got this:

I can remove security by changing the config.xml setting

<useSecurity>true</useSecurity> 

to

<useSecurity>false</useSecurity> 

And now I can access my Jenkins... But I still dont know how to create a user =/

Upvotes: 33

Views: 142324

Answers (8)

yantaq
yantaq

Reputation: 4038

This LINK has detailed steps on how to create Jenkins user. Here is the summary:

After setting

<useSecurity>false</useSecurity> 

Restart Jenkins:

sudo systemctl restart jenkins

  1. Click on People on the left-hand navigation menu.
  2. Click on the Admin. (Skip and move on to step 4 if you don't have any user).
  3. Delete the user account.
  4. Navigate to Jenkins / Manage Jenkins.
  5. Click on Configure Global Security
  6. Check the Enable Security check box. (If you don't have this item, skip and move on to next and you will able to create/add user)
  7. Under Security Realm, select Jenkins’ own user database
  8. In the Authorization section, select Logged-in users can do anything.
  9. Unselect Allow anonymous read access.
  10. Click Save to save your changes.

Upvotes: 1

Megha Chovatiya
Megha Chovatiya

Reputation: 533

Steps to create a new user

  1. Login into Jenkins
  2. Go to Manage Jenkins
  3. Go to Create Users
  4. Enter all the details – Username, Password, Confirm Pwd, FullName, Email
  5. Select Create User

Upvotes: 1

Sandy
Sandy

Reputation: 1054

Login to your Jenkins server via web URL. (http://jenkins_ip or jenkins_url:8080) Jenkins >> Manage Jenkins >> Manage Users >> Create User >> Provide the username, password, email & click on Create User.

To edit or reset or modify the password of the Jenkins' own user database users, Jenkins >> Manage Jenkins >> Manage Users >> Click the user-id from the existing user list >> Configure >> Save

Upvotes: 2

Kanav
Kanav

Reputation: 145

Once you log in Jenkins as admin, Manage Jenkins > Configure Global Security and select the "Enable Security" check box. select "Jenkins Own User Database" for the security realm under access control and then select "Logged in Users can do anything" under Authorization and Save it.

click on Manage jenkins>>Manage User >> Create User Complete the details.

Upvotes: 12

Vishwa
Vishwa

Reputation: 57

By default Jenkins uses it's own database for user management.

Go to People on Jenkins dashboard to see Users that you have, if you are not able to find an option to add user there, don't be disheartened, read on.

Go to Manage Jenkins and scroll down to bottom, second last option should be Manage Users.

By default every logged-in user can do anything, to change this, go to Manage Jenkins -> Configure Global Security -> Access Control -> Authorization -> Matrix-based security

AT THIS POINT IF YOU DON'T KNOW WHAT TO DO, PLEASE DON'T MAKE ANY CHANGES. DON'T SAVE OR APPLY.

Upvotes: 0

kenorb
kenorb

Reputation: 166389

Jenkins asks me for my username and password... but I have no idea what they are!

It depends how you configured Jenkins Access Control/Security Realm in your Configure Global Security page which determines the user authentication method, whether to use Jenkins own independent user database or external database (such as LDAP, Active Directory, Unix NIS, etc.).

If its using its own database, you can try to decrypt Jenkins passwords from credentials.xml. Otherwise disable useSecurity in your config.xml file, restart Jenkins and follow the steps. You should be asked to provide the initial password from the initialAdminPassword file (if you don't, make sure you've changed the right file and restarted Jenkins correctly).

To create user, you need to go to select your authentication method in Configure Global Security and create user either externally or if you've selected Jenkins’ own user database and tick Allow users to sign up, then hit Save button which would allow you to create user from the Jenkins interface.

Upvotes: 3

Inforedaster
Inforedaster

Reputation: 1330

in jenkins go to Manage Jenkins > Configure Global Security and select the "Enable Security" check box. select "Jenkins Own User Database" for the security realm and then select "Logged in Users can do anything" or a matrix based strategy (If you have multiple users with different permissions) for the Authorization.

Upvotes: 26

kimy82
kimy82

Reputation: 4475

You should find a file in secrets folder called initialAdminPassword with the info

Upvotes: 1

Related Questions