Issue with git plugin and private github repository

I seem to be having an issue trying to connect to a private gihub repository.  I select "default private key" as the authentication method and I am etting the following error:

The retriving current version failed:  com.jcraft.jsch.JSchException: UnknownHostKey: github.com. RSA key fingerprint  is.....


I can ssh into github.com and can git clone from the machine successfully, and github.com is in ~/.ssh/knownhosts... so I'm out of ideas.

Any help would be appreciated! Thanks!

5 comments
Comment actions Permalink

The problem is that github's private key is not on the list of known host keys maintained in the file ~/.ssh/known_hosts. The default behavior of SSH based programs is ask user whether to accept the key (and this is not possible in the server-side environment). So SSH rejects the repoistory's server. You need to do one of the following:

  1. Add the line "StrictHostKeyChecking no" to ~/.ssh/config file
  2. Add the host key to ~/.ssh/known_hosts file (it could be done by running "git ls-remote {url}" if you have git and ssh installed on that host)
  3. Use "private key" authentication method and explicitly specify a private key (this method ignores known_hosts file)


If you will choose the first method, the following lines should be added ~/.ssh/config (on accont that is used to run teamcity) in order to enable connection to github


Host github.com
StrictHostKeyChecking no


If you want to disable host key checking for all host, add the following:

Host *
StrictHostKeyChecking no



0
Comment actions Permalink

Also I have added an option to disable known_hosts check for "Default Private Key" authentication method. The change should be available in the build "pub-17".

0
Comment actions Permalink

Thanks for the answer - I downloaded the latest plugin build and checked the "known hosts database" optio, but still got an "Auth fail" error.  I then specified the private key instead of using the default and that worked.

which user account is team city looking in (on a windows environment)?  i.e. the known_hosts and conf files were in my directory, but it looks like team city wasn't reading them.  I had tried the config file option yesterday as well but all these were in my own directory.

Thanks for your help and quick reply!

0
Comment actions Permalink

If you are launching TeamCity as windows service, then by default this can be Local System account. You can change user account in the Service properties dialog > Logon tab.

0
Comment actions Permalink

The pub-19 build displays actual path to user.home that is use by teamcity server in setting dialog.

0

Please sign in to leave a comment.