Artifactory Authentication

Set up JFrog CLI authentication with RSA keys, mTLS certificates, or a custom CA.

When used with Artifactory, JFrog CLI supports several authentication methods. You must authenticate before JFrog CLI can access Artifactory.

For a complete overview of all authentication methods — including username/password, access tokens, browser login (jf login), OIDC token exchange, environment variable authentication, and troubleshooting — see Authenticating via the CLI.

This page covers Artifactory-specific authentication methods that require additional setup: RSA key authentication, mutual TLS (mTLS) client certificates, and custom CA certificate configuration.

📘

Note

The connection tests on this page (for example, jf rt ping) require a JFrog server to be configured with valid credentials. If you have not done this yet, see Authenticating via the CLI to configure a server first. To verify your current configuration, run jf config show.


Authenticate with RSA Keys

From version 4.4, Artifactory supports SSH authentication using RSA public and private keys.

Prerequisites

  1. SSH authentication must be enabled on your Artifactory server. See Manage SSH Keys in the JFrog Platform Administration documentation.

  2. Your public key must be added to your Artifactory user profile.

Limitations

🚧

Warning

RSA key authentication is NOT supported when working with:

  • External package managers and build tools (Maven, Gradle, npm, Docker, Go, NuGet)
  • The cUrl integration (jf rt curl)

Command Options

OptionDescription
--urlArtifactory SSH URL. Format: ssh://[host]:[port]
--ssh-key-pathPath to the SSH private key file.
--ssh-passphrase[Optional] Passphrase for the SSH key, if encrypted.

SSH URL Format

Configure your Artifactory URL to use the SSH format: ssh://[host]:[port]

🚧

Warning

Do NOT include the Artifactory context URL. The [host] component should only include the hostname or IP address, not the /artifactory path.

📘

Note

ssh://artifactory.mycompany.com:1339ssh://192.168.1.100:22
📘

Note

Do not use ssh://artifactory.mycompany.com/artifactory or https://artifactory.mycompany.com:1339. Both include extra path or scheme information that the SSH URL format does not accept.

To authenticate with RSA keys:

  1. Complete the prerequisites and confirm RSA is appropriate for your workflow (see Limitations under this section).
  2. Use the SSH URL format described under SSH URL Format.
  3. Run the commands for Method 1 or Method 2, depending on whether you want a saved server configuration or a per-command connection.

Configuration Methods

📘

Note

SSH authentication uses two different URL flags depending on the command:

  • jf config add uses --artifactory-url (the Artifactory-specific endpoint, for example, ssh://host:port)
  • Per-command options (for example, jf rt ping) use --url with the same SSH format

For non-SSH authentication, jf config add uses --url (the JFrog Platform URL, for example, https://acme.jfrog.io).

Method 1: Using jf config add

jf config add my-server \
  --artifactory-url=ssh://artifactory.mycompany.com:1339 \
  --ssh-key-path=~/.ssh/id_rsa \
  --ssh-passphrase=your-passphrase

Method 2: Per-Command Options

jf rt ping \
  --url=ssh://artifactory.mycompany.com:1339 \
  --ssh-key-path=~/.ssh/id_rsa

Authenticate Using mTLS Client Certificates

From Artifactory release 7.38.4, you can authenticate users using client certificates (mTLS). This requires a reverse proxy (for example, Nginx) with appropriate configuration. See HTTP Settings in the JFrog Artifactory documentation for setup instructions.

Limitations

📘

Note

Authentication using client certificates (mTLS) is NOT supported by commands that integrate with package managers.

To authenticate using client certificates (mTLS):

  1. Review the limitations above for commands that do not support mTLS.
  2. Run jf config add or per-command jf rt ping with --client-cert-path and --client-cert-key-path as shown in the Example section.

Command Options

OptionDescription
--urlJFrog Platform URL.
--client-cert-pathPath to the client certificate file in PEM format.
--client-cert-key-pathPath to the private key file for the client certificate in PEM format.

Example

Using jf config add:

jf config add my-server \
  --url=https://acme.jfrog.io \
  --client-cert-path=/path/to/client-cert.pem \
  --client-cert-key-path=/path/to/client-key.pem

Per-command usage:

jf rt ping \
  --url=https://acme.jfrog.io/artifactory \
  --client-cert-path=/path/to/client-cert.pem \
  --client-cert-key-path=/path/to/client-key.pem

Combined with Other Authentication

mTLS can be combined with username/password or access token authentication:

jf config add my-server \
  --url=https://acme.jfrog.io \
  --client-cert-path=/path/to/client-cert.pem \
  --client-cert-key-path=/path/to/client-key.pem \
  --user=myuser \
  --password=mypassword

Certificate Format Requirements

  • Both certificate and key files must be in PEM format
  • The private key file should have restricted permissions (chmod 600)

Verify certificate and key match:

📘

Note

The following commands use your system's openssl installation, not JFrog CLI. Run them in your terminal to confirm the certificate and private key are a matched pair before configuring JFrog CLI.

# These two commands should output the same MD5 hash
openssl x509 -noout -modulus -in client-cert.pem | openssl md5
openssl rsa -noout -modulus -in client-key.pem | openssl md5

Trust a Custom or Private CA Certificate

This section applies if you're not using a public CA to issue the SSL certificate for your Artifactory domain. This includes:

  • Self-signed certificates
  • Internal PKI services (for example, Microsoft CA)
  • Private Certificate Authorities

Adding Custom CA Certificates

Place your CA certificates in the security/certs directory under JFrog CLI's home directory:

~/.jfrog/security/certs/

If you've customized the home directory using the [JFROG_CLI_HOME_DIR] environment variable, use:

$JFROG_CLI_HOME_DIR/security/certs/

Certificate Requirements

RequirementDetails
FormatPEM format (file should contain -----BEGIN CERTIFICATE-----)
File Extension.pem recommended
Multiple CertificatesSupported. Run c_rehash on the directory after adding multiple certificates. c_rehash is provided by OpenSSL — install with brew install openssl (macOS) or sudo apt install openssl (Debian/Ubuntu).

To add custom CA certificates to JFrog CLI:

  1. Create the certificates directory:

    mkdir -p ~/.jfrog/security/certs
  2. Copy your CA certificate:

    cp /path/to/your-ca-cert.pem ~/.jfrog/security/certs/
  3. If using multiple certificates, run c_rehash:

    c_rehash ~/.jfrog/security/certs/

    Note: c_rehash creates hash symlinks for each valid certificate and outputs no message on success. If you see OpenSSL error messages (for example, Could not find certificate from <file>), the certificate file may be malformed or not in PEM format. Verify the file starts with -----BEGIN CERTIFICATE-----.

  4. Test the connection:

    jf rt ping --url=https://your-server.com/artifactory

    Expected output:

    OK

    Note: Replace https://your-server.com/artifactory with your Artifactory URL. If you have already configured a default server via jf config add, you can also run jf rt ping without any flags to use that server. A 401 response indicates a credentials problem with your configured server, not a CA certificate issue.

Downloading a Certificate from a Server

If you need to extract the certificate from a running server, use your system's openssl tool (not JFrog CLI):

echo | openssl s_client -servername your-server.com -connect your-server.com:443 2>/dev/null | \
  openssl x509 -out ~/.jfrog/security/certs/your-server.pem

Replace your-server.com with your Artifactory hostname. The certificate is saved to ~/.jfrog/security/certs/your-server.pem.

Fallback: Skip TLS Verification

Some commands support the --insecure-tls option, which skips TLS certificate verification:

# Per-command
jf rt ping --url=https://your-server.com/artifactory --insecure-tls

Expected output:

OK
# During configuration — include your credentials alongside --insecure-tls
jf config add my-server \
  --url=https://your-server.com \
  --access-token=your-access-token \
  --insecure-tls
📘

Note

The jf config add command above will prompt interactively for credentials if none are provided via flags. Use --access-token or --user and --password to supply credentials non-interactively (for example, in CI/CD pipelines).

🚧

Warning

Using --insecure-tls disables all certificate verification and should only be used for testing or in trusted network environments.

Migration from Versions Before 1.37.0

Before version 1.37.0, JFrog CLI expected certificates to be located directly under the security directory (not in a certs subdirectory).

  • Old location: ~/.jfrog/security/
  • New location: ~/.jfrog/security/certs/

JFrog CLI automatically migrates certificates to the new directory when upgrading to version 1.37.0 or above. A backup of the old configuration is stored in ~/.jfrog/backup.

📘

Note

Downgrading to an older version requires manually restoring the configuration from the backup directory.


Frequently Asked Questions

This section provides answers to frequently asked questions.

plusFAQs
Q: How do I authenticate JFrog CLI with Artifactory using RSA keys?

A: Enable SSH authentication on your Artifactory server, add your public key to your user profile, then run jf config add or jf rt ping with an ssh:// URL and --ssh-key-path. See Authenticate with RSA Keys.

Q: What do I need before using mTLS client certificates with JFrog CLI?

A: You need a reverse proxy, such as Nginx, configured for mutual TLS, along with a client certificate and private key in PEM format. See Authenticate Using mTLS Client Certificates.

Q: What happens if I include the /artifactory path in an RSA SSH URL?

A: The connection fails. The SSH URL [host] component must contain only the hostname or IP address and port, not the /artifactory context path. See SSH URL Format.

Q: What is the difference between RSA key authentication and mTLS client certificates?

A: RSA key authentication uses SSH and a key pair tied to your Artifactory user profile. mTLS uses HTTPS client certificates validated by a reverse proxy. Neither method is supported by commands that integrate with package managers.

Q: Can I use a self-signed or private CA certificate with JFrog CLI?

A: Yes. Place the CA certificate in ~/.jfrog/security/certs/; if you're adding multiple certificates, also run c_rehash on that directory. See Trust a Custom or Private CA Certificate.

Related Topics


What’s Next

Once authenticated, upload your first file to Artifactory.

Did this page help you?