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

  1. Go to your Jenkins dashboard on http://<your-ip>:8080
  2. Click on ‘Manage Jenkins’ and select the ‘Available’ tab.
    manage jenkins
  3. On the search bar, type “role-based” and press Enter.
    role based
  4. Now, select the Plug-in and from there click on ‘Install without restart’ button.
    install without restart

Enabling Role-Based Strategy on Jenkins

  1. Go to ‘Manage Jenkins’ and then click on ‘Configure Global Security’.

    configure global security

    create and manage users in jenkins
    Click on the Enable security checkbox.

  2. Search for the Security Realm section, select ‘Jenkins’ own user database’.
    a) In the Authorization section, select ‘Role-Based Strategy’.
    role based strategy
    Click on Save.
  3. Now you will be asked to add your first user. Enter necessary details for your user.

How To Create User on Jenkins

  1. Go to manage Jenkins and then scroll down, you will see the ‘Manage Users’ option. Click on this option.

    create users on jenkins

  2. Start creating other users for the system.
    a)Click on ‘Create User’ option on the left hand side of the Manage Users page:
    create user jenkins
    b)Enter the user details and click on Create User button

Manage User Roles on Jenkins

  1. 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.

    manage and assign roles

  2. Click on Manage Roles option.
    manage roles option
  3. 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.

    role developer jenkins

How To Assign User Roles on Jenkins

  1. 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

    users roles on jenkins

  2. 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.

    add user name on user group

  3. Select “developer” role check box.
Subscribe Now