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 1Configure 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 2Create/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 3Create SSH keys for the desired user (in this case admin):
$ ssh-keygen -t rsa -C "admin@art.test.com"
Step 4Add the public key from this pair to the admin user profile (Top right corner → Edit Profile → SSH Public Key).
Step 5Add 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 6Edit 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.