PaulJ
PaulJ

Reputation: 1717

Cannot push into remote git repository

I am trying to give a new developer access to our private git repository. First of all, some antecedents:

Anyway: he can clone the git repository to his local machine without problems, but when he tries to push the changes he gets an error: "fatal: protocol error: bad line length character: ramo"

We saw the answer to this question, so I told him to do:

ssh ramon@[server.name] git-receive-pack /var/git/[repository name]

And the response he got was:

008c61c2ff5944d78bf10df33731c40cf972a0e4bfb2 refs/heads/[branch name 1] report-status delete-refs side-band-64k ofs-delta
004c9c518491c3f863b2830dcb4d0dbe9cd7919ba50b refs/heads/[branch name 2]
004eb7909056d60b8188e8e41d6b614c8e88e2cf848b refs/heads/[branch name 3]
004c3ef6b4c43034157dcce61e2a98c84ad7e7c695c9 refs/heads/[branch name]
004d4d423c5dc669f7d827b63d9c29c11b569281f391 refs/heads/[branch name]
004f6cfbabad11009a2c451ad8cf9e1837b417394e7e refs/heads/[branch name]
00494c96774aad57f200fe61e56d12fd5c69f6154139 refs/heads/[branch name]
004777ef2fc618ccacad372cd720f95591d4a347fc92 refs/heads/call_to_action
00490bad8d61d3213c1ece42a4e0f432e053ce9eeef9 refs/heads/[branch name]
004061ae4b7acec207773adff985bc6cf504a107aadc refs/heads/carrito
0052ca13ffe125f3b96b7176654e6ac5a472525c4019 refs/heads/[branch name]
004fe341b335ca9bd57d9e1bd0a69d75879292313a8c refs/heads/[branch name]
004288b199d02b21a26b5e3ce25c204b49b80ef63ac5 refs/heads/etiquetas
003d4cb828f02d61054e0320dead63c7f285ca84dfc3 refs/heads/help
004ba9baf7fd376ddc2017222fe07fa2a4c496e129fd refs/heads/[branch name]
005991a2b4b742e2f1793e71d85a0565aec4fa65b415 refs/heads/[branch name]
0048f6545418765d79a3c07

Which looks fine to me (or at least looks like it's the git protocol).

We then tried to set up his public key in the machine. He sent me his public key, which looked something like:

ssh-rsa [key blablablabla] raimo@DESKTOP

I added it to his authorized_keys file in his user account at the git box, but the exact same thing happened. He couldn't push using git, and the error I got in the server logs was:

sshd[14411]: Failed publickey for ramon from [ip address]

All the while, he can SSH into the server using PuTTY without problems. (Now that I think of it, I didn't ask him to SSH using the command line SSH client in git bash; will report back with results).

What's going on?

Upvotes: 1

Views: 99

Answers (1)

VonC
VonC

Reputation: 1329092

First, check on the remote server if the .profile/.bashrc of ~ramon does any kind of echo, display anything. If it does, that could disturb some git commands like clone.


Locally, check the value if his environment variable GIT_SSH

If it is TortoisePlink.exe:

  • try settings it to ssh.exe as in here
  • use putty to convert the ppk keys into an id_rsa/id_rsa.pub private/public key

The OP PaulJ confirms in the comments it was an SSH key issue

In the end the problem turned out to be simply that he hadn't configured his public/private key pair correctly.

Upvotes: 1

Related Questions