JFROG CLI: Configure JFrog CLI to authenticate using SSH
JFrog Artifactory supports SSH authentication for Git LFS and the JFrog CLI using RSA public and private keys. This allows these tools to exchange sensitive information with the Artifactory server that is authenticated via SSH. You will need to configure SSH keys to authenticate requests sent to the JFrog Platform from Git LFS client or from the JFrog CLI. In the following article, we will be configuring JFrog CLI to authenticate using SSH.
Prerequisites:- SSH keys. Please refer to this table for Supported Values By Algorithm Type for SSH Configuration
- Admin user access to configure SSH Server Settings.
- Access to public and private SSH keys.
- User with edit profile access.
In order to configure SSH authentication between JFrog CLI and Artifactory, we will need to perform the following three main steps:
- Configure SSH Server settings.
- Configure User Authentication to use SSH.
- Configure JFrog CLI.
Configuring SSH Server SettingsWe need to add the keys in the Artifactory Key Management in order to configure Artifactory to use SSH Authentication. Perform the following steps to do the same.
- Go to Artifactory UI => Administration => Artifactory => Security => Keys Management => SSH Keys.
- Enable the SSH Authentication using the check box.
- Default port 1339 will be pre selected. Configure as per the requirement.
- For the Custom Base URL field, we will need to configure the Custom Base URL by adding the URL at Artifactory UI => Administration => General => Settings => Custom Base URL. “http(s)://artifactoryHost:port”
- Now we need to add the Public Key and the Private key in the respective fields.
- Save the configuration.
Configure User Authentication to use SSHAfter setting the SSH Server Settings, we need to configure each user that will be using SSH Authentication. Perform the following steps for each user that needs SSH Authentication.
- Login as a user to Artifactory.
- Go to Edit Profile. Welcome User => Edit profile. Provide the password and unlock.
- We need to add the SSH public key of the user, which was added in the previous step. Scroll down to find SSH, click on “Add New SSH Key”. Provide a Key Alias and the public SSH Key. Click on Add.
- Click on Save

Configure JFrog CLIAfter performing the previous two steps we need to set the client, in this case JFrog CLI, to authenticate using SSH. Perform the following steps to configure the same.
- In the terminal, enter “jf config add ServerName”. We can modify the server name as per requirement.
- This will prompt you to add a JFrog Platform URL. For that, the URL should be following this format. “ssh://artifactoryHost:port”. Modify the artifactoryHost and port as provided in step 1. Default is 1339.
- Then it will ask to provide an SSH key file path. Set it to the path where the private key is stored.
- Hit Enter
Test the Configuration
To check if the CLI is configured correctly, perform “jf rt ping”. On successful configuration, we will see “OK” msg. Note: If there are multiple servers pre configured, either set the required server id as default by performing “jf config use ServerName” or perform “jf rt ping –server-id ServerName”.
The above steps should successfully configure JFrog CLI to use SSH Authentication. For more information on Managing SSH Keys in JFrog refer to this article.