Following is the link to setup SSH configuration for working with Git lfs repositories in Artifactory. Please note that "passphrase" is not to be provided when you are creating SSH keys for server authentication. If the "passphrase" is provided when you generate the SSH keys for server authentication, then you will see an error like the below example when attempting the git lfs push to Artifactory.
(0 of 1 files) 0 B / 4.09 MB
Post https://localhost/artifactory/gitlfs-local/objects/batch: dial tcp [::1]:443: getsockopt: connection refused
In the artifactory.log you will notice the below exception for the failed attempt:
2016-01-18 18:49:12,089 [sshd-SshServer[f4220a5]-nio2-thread-2] [WARN ](o.a.s.s.s.ServerSession:456) - Exception caught
org.apache.sshd.common.SshException: sendKexInit() none of the keys appears in supported list: [ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-dss, ssh-rsa]
The other reason for the failure to push to Artifactory when using SSH authentication is if you have provided an incorrect SSH port to be connected to Artifactory in the ".git/config" file which is under the local git repository. The url in this file should have the SSH port that is configured in Artifactory during the SSH server configuration. Below is a sample ".git/config" file with the Artifactory URL highlighted:
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
fetch = +refs/heads/*:refs/remotes/origin/*
remote = origin
merge = refs/heads/master
url = "ssh://git@localhost:1339/artifactory/gitlfs-local"
Mymac-MBP:project-examples mac$ ssh <ServerName> -p <port> git-lfs-authenticate artifactory/<reponame> download 0abcd
The command should look like the below example:
ssh 127.0.0.1 -p 1339 git-lfs-authenticate artifactory/gitlfs-local download 0abcd
If the SSH auth is successful, you should see the below output.