How To Create and Manage Users in Jenkins
We can create multiple users in Jenkins to run the build, in large organization there are many persons, but for running the build only one person is not responsible, example: for running the staging environment build we can create a developer role for building a particular job.
You will have to install the Role strategy Plug-in for enabling different roles and privileges to Jenkins users..
Install Role-based Authorization Strategy Plug-in
- Go to your Jenkins dashboard on http://<your-ip>:8080
- Click on ‘Manage Jenkins’ and select the ‘Available’ tab.
- On the search bar, type “role-based” and press Enter.
- Now, select the Plug-in and from there click on ‘Install without restart’ button.
Enabling Role-Based Strategy on Jenkins
- Go to ‘Manage Jenkins’ and then click on ‘Configure Global Security’.
Click on the Enable security checkbox. - Search for the Security Realm section, select ‘Jenkins’ own user database’.
a) In the Authorization section, select ‘Role-Based Strategy’.
Click on Save. - Now you will be asked to add your first user. Enter necessary details for your user.
How To Create User on Jenkins
- Go to manage Jenkins and then scroll down, you will see the ‘Manage Users’ option. Click on this option.
- Start creating other users for the system.
a)Click on ‘Create User’ option on the left hand side of the Manage Users page:
b)Enter the user details and click on Create User button
Manage User Roles on Jenkins
- For managing user
a)Click on Manage Jenkins.
b)Select Manage and Assign Roles. Remember that, Manage and Assign Role will only be visible if you have installed the Role strategy Plug-in. - Click on Manage Roles option.
- To create a new role called “developer”.
a)Type “developer” in the Role to add option.
b)Click on Add to create a new role.
c)Now, select the appropriate permissions that you want to assign to the developer role.
d)Then Click on the Save button.
How To Assign User Roles on Jenkins
- Let’s assign the created role to specific users.
a)Click on Manage Jenkins.
b)Then select Manage and Assign Roles.
d)Click on Assign Roles - Let’s add new role “developer” to user
a) Add the User name on User/group to add options.
b) Click on the Add button. - Select “developer” role check box.