Create new user in jenkins
To create a new user in Jenkins, you can follow these steps:
Method 1: Using the Jenkins Web Interface
- Log in to your Jenkins instance as an administrator.
- Click on the "Configure Jenkins" link in the left-hand menu.
- Scroll down to the "Security" section.
- Click on the "Users" link.
- Click on the "New User" button.
- Fill in the required information for the new user, including:
- Username: Enter a unique username for the new user.
- Full name: Enter the full name of the new user.
- Email: Enter the email address of the new user.
- Password: Enter a password for the new user.
- Confirm password: Re-enter the password to confirm.
- Click the "Create" button to create the new user.
Method 2: Using the Jenkins CLI
- Open a terminal or command prompt and navigate to the Jenkins CLI directory.
- Run the following command to create a new user:
java -jar jenkins-cli.jar create-user <username> <full-name> <email> <password>
Replace
<username>
,<full-name>
,<email>
, and<password>
with the desired values for the new user.
For example:
java -jar jenkins-cli.jar create-user johnDoe John Doe [email protected] mysecretpassword
This will create a new user named "johnDoe" with the specified full name, email address, and password.
Method 3: Using the Jenkins API
- Open a web browser and navigate to the Jenkins API page.
- Click on the "Create User" button.
- Fill in the required information for the new user, including:
- username: Enter a unique username for the new user.
- full_name: Enter the full name of the new user.
- email: Enter the email address of the new user.
- password: Enter a password for the new user.
- Click the "Create" button to create the new user.
Note: You can also use the Jenkins API to create a new user using a JSON payload. For example:
curl -X POST \
http://your-jenkins-instance.com/api/users \
-H 'Content-Type: application/json' \
-d '{"username":"johnDoe","fullName":"John Doe","email":"[email protected]","password":"mysecretpassword"}'
Replace your-jenkins-instance.com
with the URL of your Jenkins instance.