Git in TeamCity: Unable to load identity file - public SSH key

I've been spending hours trying every combination to get git work with TeamCity.  I'm working with a team that has their own github instance-  When trying to authenticate agains the server, I'm getting this error:

Unable to collect changes: jetbrains.buildServer.vcs.VcsException: Problem collecting changes for 'PROJECTX' : Repository '': Unable to load identity file: c:\temp\ (passphrase protected)

I'm able to clone directly from the github server using the ssh key.  I've copied it to 5 different places to make sure it's not a permissions issue accessing the key.

They key was generated following these instructions: (ssh-keygen-t rsa -C "").  

The TeamCity setup:

Type of VCS:  Git
Fetch URL:
Authentication Method:  Private Key
User name:  (blank)
Private Key Path:  c:\temp\

I've tried variations of the location of the file.  I've tried other Authentication methods:  1) Anonymous (not supported by server), 2) Default Private Key (List remote refs failed: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh:// Password for ), and 3) Password (Test connection failed in Platform Tools :: Deploy-Git. Connection test failed: com.jcraft.jsch.JSchException: Auth fail)

Running out of options.  I've seen where users used PuttyGen to generate their key, but it appears that ssh-keygen is the supported key generator.

Comment actions Permalink


Do you use server-side or agent-side checkout mode?

Comment actions Permalink

VCS checkout mode:  Automatically on agent (if supported by VCS roots).

Just to eliminate potential problems, I've given it a local checkout directory as well.  

Comment actions Permalink

I would generate a key which does not include a passphrase and use this first as i believe your problem is probably that you need to enter the pass phrase to continue.  We have the same setup as you and are able to pull changes from github using a key which has no passphrase.  I would also check that you have added the SSH key to a user for that GitHub repository

Comment actions Permalink

If you've got it working, what "Authentication Method" are you using?  I've created a key without a passphrase and added the key to our github instance.  I'm getting this error testing the Private Key option:

Test connection failed in Test-Project. Repository '': Unable to load identity file: c:\temp\

The account name on the github is jbalfantz, the email on the ssh key is "," and I've tried the username as both jbalfantz and (blank).  I'd like to copy your settings since they've worked for you, so I have a working example I can build towards.

Comment actions Permalink

We use the User name style of UserId (jsmith) and the Authentication method of Default Private key with a blank user name entry.

The key files and the config file are in the ~\.ssh\ folder and I tested the connection using the instructions in step 5 of first and once that was working I was able to use the agents successfully.

The contents of our config file in the .ssh folder are:

  Port 443
  StrictHostKeyChecking no

which allows the ssh connection to be tunneled through the firewall on port 443, as our firewall was also blocking it.

Hope this helps.

Please sign in to leave a comment.