Among the actions that a Jenkins user can perform include:
- Setting up and configuring Jenkins on a server.
- Creating and managing the build jobs in Jenkins to automate the build, test, and deployment process.
- Monitoring the status of builds and tests, and receiving notifications when the build or test failures occur.
- Analyzing the build logs and test results to identify the problems and debug issues.
- Integrating Jenkins with the other tools and services such as source control systems, test frameworks, and deployment tools.
In this tutorial, you will learn how to configure a new user in the Jenkins cluster in a few simple steps.
Create a New User in Jenkins in the Administrative Dashboard
To set up a new user in Jenkins, start by logging into your Jenkins controller.
http://localhost:8080
Once logged in, navigate to the Jenkins dashboard and select “Manage Jenkins”.
Under the Security Interface, select “Manage Users”.
Finally, select “Create User” to add a new user to the Jenkins server.
In the “Create User” window, add the details of the user that you wish to create such as the target username, password, full name, and email address.
Once satisfied with the details, click “Create User” to add the specified username to the server.
You can then view the list of available users in the server by navigating to Manage Jenkins -> Manage Users.
Another way to view the available users in the server is to use the “People” section in the Jenkins dashboard.
The user list is as follows:
Create a New User in Jenkins Using CLI
You can also add a new user to the Jenkins server using the command line by running the command as shown in the following:
Since there is no direct command to add a new user to the Jenkins server, we can use a groovy script to allow Jenkins to create a new user from the terminal.
The previous command creates a new user with the “linuxhint2” username and the “password123” password.
You can then go to the Jenkins dashboard – People to view the list of available users.
Conclusion
We discussed how to use the Jenkins Administrative dashboard to create a new Jenkins user. We also discussed how to use a Groovy script to invoke the user creation in Jenkins from the command line.