Create a user in Artifactory
Create a user in Artifactory
Create a new user in Artifactory with username, password, and email using jf rt user-create.
Prerequisites
- JFrog CLI installed β see the install guide
- A configured server (
jf config add) or an Artifactory URL and admin access token to pass inline- Admin privileges on the target Artifactory instance
Synopsis
jf rt user-create <username> <user-password> <email> [options]
Aliases: none
Arguments
| Argument | Required | Description |
|---|---|---|
<username> | Yes | Username for the new user |
<user-password> | Yes | Login password for the new user (not the CLI's own authentication password) |
<email> | Yes | Email address for the new user |
Options
| Flag | Default | Description |
|---|---|---|
--access-token | β | JFrog access token |
--admin | false | Set to true to create an admin user |
--password | β | JFrog password (for authentication) |
--replace | false | Set to true to replace existing users or groups |
--server-id | β | Server ID configured using jf config |
--ssh-key-path | β | SSH key file path |
--ssh-passphrase | β | SSH key passphrase |
--url | β | JFrog Artifactory URL (example: https://acme.jfrog.io/artifactory) |
--user | β | JFrog username |
--users-groups | β | Comma-separated list of groups for the new user to join. Groups must already exist in Artifactory. |
Examples
Help
To view command help:
- Run:
jf rt user-create --helpExpected output: CLI prints the command synopsis, arguments, and all available flags.
Basic Usage
To create a user:
- If you use a pre-configured server (recommended β avoids exposing the token in shell history), run:
jf rt user-create <username> <user-password> <email> --server-id=<server-id>- If you use inline credentials instead, run:
jf rt user-create <username> <user-password> <email> --url=<artifactory-url> --access-token=<Token>Where:
<username>,<user-password>, and<email>β values for the new user (see Arguments).<server-id>β server ID fromjf config.<artifactory-url>β base Artifactory URL.<Token>β admin access token (do not paste real tokens into shared history).
Full examples:
jf rt user-create jdoe 'P@ssw0rd!' [email protected] --server-id=acme
jf rt user-create jdoe 'P@ssw0rd!' [email protected] --url=https://acme.jfrog.io/artifactory --access-token=<Token>Expected output:
[Info] Creating user <username>...
A silent exit 0 with no error message means the user was created successfully.
Create User with Groups
Note
The groups specified in
--users-groupsmust already exist in Artifactory. Usejf rt group-createto create them first.
To create a user and assign groups:
- Run:
jf rt user-create <username> <user-password> <email> --users-groups <users-groups> --server-id=<server-id>Where:
<users-groups>β comma-separated list of existing group names (no spaces).
Full example:
jf rt user-create jdoe 'P@ssw0rd!' [email protected] --users-groups developers,readers --server-id=acmeExpected output:
[Info] Creating user <username>...
Create Admin User
To create an admin user:
- Run:
jf rt user-create <username> <user-password> <email> --admin --server-id=<server-id>Full example:
jf rt user-create admin-user 'P@ssw0rd!' [email protected] --admin --server-id=acmeExpected output:
[Info] Creating user <username>...
Overwrite an Existing User
Use --replace to reset a user's password, email, or group membership:
To replace an existing user:
- Run:
jf rt user-create <username> <new-user-password> <new-email> --replace --server-id=<server-id>Full example:
jf rt user-create jdoe 'NewSecret!' [email protected] --replace --server-id=acmeExpected output:
[Info] Creating user <username>...
When to Use
Use jf rt user-create to create a single user in Artifactory. For bulk user provisioning, use jf rt users-create with a CSV file instead.
Common scenarios:
- Service accounts: Create dedicated service accounts for CI/CD pipelines
- Testing: Create temporary users for integration testing (delete them after with
jf rt users-delete) - Automation: Part of an onboarding script that creates a user, adds them to groups, and sets permissions
Important Notes
- Requires admin privileges on the Artifactory instance.
<user-password>is the new user's login password. The--passwordflag in Options is a separate credential used to authenticate the CLI itself to Artifactory β do not confuse the two.- Use
--replaceto overwrite an existing user with the same username (see the Overwrite an Existing User example above). - Passwords are sent over HTTPS. Ensure your Artifactory instance uses TLS.
Updated about 1 month ago
