Jenkins User Management

JenkinsJenkinsBeginner
Practice Now

Introduction

In this lab, we will explore user management in Jenkins, a crucial aspect of maintaining a secure and organized continuous integration environment. You will learn how to create new user accounts, modify user details, and remove users from the system. This hands-on experience will provide you with practical skills in Jenkins administration, focusing on user management tasks that are essential for controlling access and maintaining security within your Jenkins environment.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL jenkins(("`Jenkins`")) -.-> jenkins/UsingJenkinsGroup(["`Using Jenkins`"]) jenkins(("`Jenkins`")) -.-> jenkins/ManagingJenkinsGroup(["`Managing Jenkins`"]) jenkins(("`Jenkins`")) -.-> jenkins/InstallingJenkinsGroup(["`Installing Jenkins`"]) jenkins/UsingJenkinsGroup -.-> jenkins/role_based_authorization("`Role-based Authorization`") jenkins/ManagingJenkinsGroup -.-> jenkins/manage_users("`Manage Users`") jenkins/InstallingJenkinsGroup -.-> jenkins/initial_settings("`Jenkins Initial Settings`") subgraph Lab Skills jenkins/role_based_authorization -.-> lab-391302{{"`Jenkins User Management`"}} jenkins/manage_users -.-> lab-391302{{"`Jenkins User Management`"}} jenkins/initial_settings -.-> lab-391302{{"`Jenkins User Management`"}} end

Accessing Jenkins and Creating a New User

In this step, we'll access the Jenkins web interface and create a new user account. This process is fundamental for adding team members or other stakeholders to your Jenkins environment.

First, let's access Jenkins:

  1. Open Firefox web browser in your VM Desktop. If you're using a terminal, you can open Firefox by clicking on the Firefox icon on the desktop. This icon typically looks like an orange fox wrapped around a blue globe.

    Firefox Icon

    Note: If you don't see the Firefox icon, you can also open it by right-clicking on the desktop and selecting "Open Terminal," then typing firefox and pressing Enter.

  2. In the Firefox address bar, type http://127.0.0.1:8080 and press Enter. This is the default address for your local Jenkins instance. The number 127.0.0.1 is known as the localhost IP address, which refers to your own computer. Port 8080 is the default port that Jenkins uses.

  3. You'll see the Jenkins login screen. Use the following credentials to log in:

    • Username: admin
    • Password: admin
    Jenkins Login Screen

    Tip: If you're having trouble logging in, make sure your Caps Lock isn't on and that you're using the correct username and password. Jenkins is case-sensitive.

Now that we're logged in, let's create a new user:

  1. In the Jenkins dashboard, look for "Manage Jenkins" in the left sidebar. This is where all administrative tasks are performed.

  2. Scroll down the Manage Jenkins page and click on "Users" under the Security section. This will take you to the user management area.

  3. On the Manage Users page, find and click on "Create User" in the left sidebar. This option allows you to add a new user to the system.

  4. You'll see a form to create a new user. Fill in the following details:

    • Username: labex (This is the unique identifier for the user)
    • Password: 123456 (For security reasons, you should use a stronger password in a real-world scenario)
    • Confirm password: 123456 (Type the password again to confirm)
    • Full name: Lab User (This name will be displayed in Jenkins)
    • E-mail address: [email protected] (This is used for notifications)
  5. Double-check all the information you've entered, then click the "Create User" button at the bottom of the form.

Create User Form

After creating the user, you should see the new labex user listed on the Manage Users page. If you don't see the new user, try refreshing the page.

Modifying User Account Details

In this step, we'll modify the details of the user account we just created. Specifically, we'll update the user description. This is useful for adding notes about a user's role or responsibilities.

  1. From the Jenkins dashboard, click on "Manage Jenkins" in the left sidebar. This brings you back to the main administration area.

  2. Click on "Users" under the Security section. This takes you to the user management page where you can see all existing users.

  3. Find the labex user in the list. Next to the user's name, you'll see a small gear icon. Click this icon to access the user's details.

    User List with Gear Icon

    Note: If you don't see the gear icon, make sure you're logged in as an admin user with sufficient permissions.

  4. On the user's configuration page, scroll down until you find the "Description" field. This field allows you to add additional information about the user.

  5. In the Description field, enter the following text: this is the labex

    Tip: Be precise with your entry. Ensure there are no extra spaces before or after the text, as this could cause the verification to fail.

  6. After entering the description, scroll to the bottom of the page and click the "Save" button to apply the changes.

    User Description Field

    Note: If you don't see the changes reflected immediately, try refreshing the page.

This process allows you to add or modify information about a user, which can be helpful for administrative purposes or for providing context about user roles within your Jenkins environment.

Deleting a User Account

In this final step, we'll learn how to remove a user account from Jenkins. This is useful when an account is no longer needed or when you're cleaning up your user list. It's an important skill for maintaining the security of your Jenkins instance.

  1. If you're not already there, navigate back to the Jenkins dashboard by clicking on the Jenkins logo in the top-left corner.

  2. Click on "Manage Jenkins" in the left sidebar, then click on "Users" under the Security section to return to the user management page.

  3. In the user list, find the labex user we created earlier. Next to the user's name, you'll see a small trash can icon. This is the delete button.

    Delete User Icon

    Note: If you don't see the trash can icon, ensure you're logged in as an admin user with sufficient permissions.

  4. Click on the trash can icon. A confirmation dialog will appear. This is a safety measure to prevent accidental deletions.

  5. Read the warning message carefully. It will inform you about the consequences of deleting a user.

  6. If you're sure you want to delete the user, click "Yes" to confirm.

    Caution: This action is irreversible. Once a user is deleted, you cannot undo this action without restoring from a backup.

After confirming, the labex user should be removed from the user list. Refresh the page if you don't see the change immediately.

It's important to note that deleting a user is a permanent action. While it removes the user's ability to log in, it doesn't automatically remove that user from existing job configurations or other settings where the username might be referenced. Always be cautious when deleting users and ensure you understand the implications for your Jenkins setup.

Summary

In this lab, we explored the essential aspects of user management in Jenkins, a crucial skill for any Jenkins administrator. Let's recap what we've learned:

  1. Creating a New User: We started by learning how to add a new user to Jenkins. This process involves navigating the Jenkins interface, accessing the user management area, and filling out the necessary details to create a new account. This skill is fundamental when you need to provide access to new team members or stakeholders.
  2. Modifying User Details: Next, we learned how to update user information, specifically by adding a description to a user account. This ability to modify user details is valuable for maintaining clear information about each user's role or purpose within your Jenkins environment. It can help with organization and clarity, especially in larger teams.
  3. Deleting a User Account: Finally, we covered the process of removing a user from Jenkins. This is an important skill for maintaining the security and cleanliness of your Jenkins instance. We learned about the permanence of this action and the need for caution when performing it.

These user management skills are crucial for effectively administering Jenkins, especially in team environments or organizations where multiple users need access to the system. By controlling user access and maintaining accurate user information, you can ensure better security and organization within your Jenkins setup.

Other Jenkins Tutorials you may like