jmollan / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

Repo ignores url.insteadOf and causes Server SSH fingerprint mismatch #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version: v1.6.8.6
Environment: CentOS 2.6.18-92.1.10.el5, 64bit, 1TB HD, 20GB RAM

We have a pr-established development and build environment using git and 
repo, which we are now transitioning to use Gerrit.

As we wanted to reduce the burden on ~2000 developers, we just asked them 
to add something to their .gitconfig file:

[url "ssh://git01.blurdev.com:29418/"]
    insteadOf = ssh://git.blurdev.com/

Consider the scenario:
- If I go to Gerrit -> Settings -> SSH Keys, I'll see fingerprint-A, and my 
server's RSA key-A
- If I go to /etc/ssh, I'll see a fingerprint-B and a different RSA key-B

When I do "repo init", it adds the RSA key-A (the one from Gerrit) to my 
known_hosts file.

Then, when I do "repo sync" it tries to add RSA key-B to the known_hosts 
file and it throws me the error below:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
-- fingerprint-B --
Please contact your system administrator.
Add correct host key in /home/.../.ssh/known_hosts to get rid of this 
message.
Offending key in /home/.../.ssh/known_hosts:1
RSA host key for review_server has changed and you have requested strict 
checking.
Host key verification failed.
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/bionic

It looks like repo is not considering the URL replacement set on the 
.gitconfig file and it goes directly to the URL specified in the manifest, 
causing the error above.

For more details, please follow the discussion thread: 
http://groups.google.com/group/repo-
discuss/browse_thread/thread/c2a8068e6ca83118

Original issue reported on code.google.com by lscar...@gmail.com on 11 Mar 2010 at 12:49

GoogleCodeExporter commented 9 years ago
This works fine last I tried it in 04/11 or so... suggest retrying it.

Original comment by ferri...@google.com on 22 Dec 2011 at 1:55