ARTIFACTORY: How to Authenticate a Git LFS Repository via SSH

AuthorFullName__c
Sam Rosenstein
articleNumber
000005189
FirstPublishedDate
2021-12-27T08:28:29Z
lastModifiedDate
2025-05-14

ARTIFACTORY: How to Authenticate a Git LFS Repository via SSH

The following article describes how to authenticate your Artifactory Git LFS repository  via SSH. 

 

Step 1

Configure the Artifactory custom base URL (Admin → General → Settings → ​​Custom Base URL). For this demonstration, I see the Base URL to the following:

http://art.test.com

The next steps go through the process of creating and uploading SSH keys  for the server and the Artifactory user. 

Step 2

Create/Upload SSH keys for the server:

$ ssh-keygen -t rsa -C "server@art.test.com"

And upload these keys as the SSH keys in Artifactory.

Step 3

Create SSH keys for the desired user (in this case admin):

$ ssh-keygen -t rsa -C "admin@art.test.com"
Step 4

Add the public key from this pair to the admin user profile (Top right corner → Edit Profile → SSH Public Key).

 

Step 5

Add the server public key (created in step 2) to the known_hosts file:

[<server_custom_base_URL>]:<server_port> <content of the Artifactory server public ssh key>

In this case, this looked like the following:

$ cat ~/.ssh/known_hosts
> art.test.com:1339 <content of server public ssh key>

 

Step 6

Edit the .lfsconfig file to reflect the current configuration using SSH:

$ cat .lfsconfig
[lfs]
url = "ssh://admin@art.test.com:1339/artifactory/git-lfs-local"

Afterwards, It should be possible to authenticate the Artifactory Git LFS repository using SSH.