Problem SSH authentication for Git with default private key

I know this topic has been disccused before and I have tried a number of the solutions described but find myself going around in circles witrh no solution to my problem

We require agent side git checkouts.
So this forces us to use the default private key option

Using tortoise git I'm able to ssh into git using private key authorisation  ( this is using the Pageant   authorisation agent).
Putty was used to generate the private/public keys

I then exported the key as an OPenSSH  key .
I have verified this key works in Teamcity by setting Teamcity to use a private key file and setting the private key path to this file.
This works and I am able to access the git repository files ( all be it on the server side  )

When the default private get option is selected   I get the following advisory
"Uses mapping specified in the file C:\Windows\System32\config\systemprofile\.ssh\config if that file exists."

I created a config file in  C:\Windows\System32\config\systemprofile\.ssh  with the following text

PreferredAuthentications publickey
IdentityFile C:\Users\stewarth\.ssh\private_key
StrictHostKeyChecking no

I have ticked
Ignore Known Hosts Database:  

The fetch URL   ssh://OPTISCAN\\stewarth@vmBldSvr/srv/git/repos/Devices

When the build is run it reports the following error
Failed to collect changes, error: List remote refs failed: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://OPTISCAN\\stewarth@vmBldSvr:22: Password:

Any suggestions would be most welcome

1 comment
Comment actions Permalink

I have resolved this issue.

My original problem had been caused by using putty to generate my keys.
It was only after many failures that I found the private key needed to be an Open_ssh key .
As stated, I used the export option of puttygen to create this exported key

In trying various options I had set my services  to started as system accounts.  Turns out they  did not have the correct privileges to access the keys correctly.
Why they worked as ”private keys”  I do not know..  but certainly they did not work as “default private keys”

By uninstalling TeamCity and reinstalling it as  local user for both server and agent ( both currently running on the same PC )  my problems were solved  and I now have agent side running with default private keys


Please sign in to leave a comment.