tags:

views:

2002

answers:

8

So I thought I had finally got everything setup on Windows ... then ran into this issue.

Current setup

URL: ssh://user@host:port/myapp.git

Already run Putty - and can connect using valid .ppk keys through the ~/.ssh/authorized_keys direct. In Git and TortoiseGIT - I set both to use "plink.exe".

Putty works fine - no issues - but when I run that URL into bash I get for a git clone (url)

fatal: the remote end hung up expectedly

In a cygwin bash terminal - running "ssh user@host" - works no probs at all.

Anyone suggest anything?

A: 

My guess is that there's no git in $PATH on remote end.

Michael Krelin - hacker
would be able to elaborate a little ? :)
try `ssh user@host git --version`
Michael Krelin - hacker
hi well it doesn't work because of authenication prob = but its 1.6.4.msysgit.0
I wasn't asking for git version, but for this command's output. Didn't you say that `ssh user@host` "works no prob at all" ?
Michael Krelin - hacker
hey :) yeah this doesnt work unfortnately for git bash. for cygwin bash it works fine - but from git it doesn't. i just cant understand what is going on - everything i have tried doesn't work. putty works fine - when try and clone, i just get "fatal: the remote end hung up" - the pub/priv keys are correct as putty works ? both git and msysgit use plink ?
actually ok - :) got something like "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" - at the end it says "Host key verification valid"
even when i delete the know_hosts file - the RSA fingerprint remains the same (when I run it again) ? does this mean I am missing something or ?
RSA fingerprint is not supposed to change. But when you connect for the first time after removing known_hosts you will have to confirm the identity so that it is stored in known_hosts
Michael Krelin - hacker
So, what happens if you do the `ssh stunt` from git's bash *twice* after removing known_hosts (and make sure you remove proper known_hosts - after it is removed there should be no message about *changed* identity).
Michael Krelin - hacker
A: 
Dmitry
hi - thanks for the response. how to check if git knows that it should be using plink ?
btw - ok did echo $SSH_GIT and got the relevant correct path. i also tried plink -P portnumber user@host -i /path/to/key/ and this connected successfully - its just git that aint working.
How about if you try setting GIT_SSH instead of SSH_GIT.
Dmitry
hi sorry yeah it was set to this. i just cant figure this out - i can connect via putty and plink (command line) but not GIT. everytime i attempt to clone the repo i get "failed hung up unexpectedly"
is there anyway to log what is happening when i attempt to clone via GIT ? i.e. someway to see what plink.exe is doing or ?
please check the update in the answer, it didn't fit in comment field.
Dmitry
A: 

I have exactly the same issue.

I don't use Putty (just Cygwin). I use Windows 7 Ultimate (fully patched as of this moment). I just installed Cygwin yesterday.

I made sure binary mounts were being used.

If I copy a git repo to the machine (via samba mount), I can clone it, but when I "git diff" after the clone, there are a bunch of "different" files with no diffs. After a "git status" there was no output from "git diff". It seems like a newline thing, but I can't figure out how that would be happening. (I have igncr in SHELLOPTS, but removing that doesn't fix it.)

I'm completely stumped.

e40
Btw, ssh to the git host produces no extraneous output.
e40
I think this is a Cygwin 1.7.1 issue. I just upgraded a machine running Cygwin 1.5 to 1.7.1 and a working git there now fails in the same way.I have posted something to [email protected], and will report back here if there is a resolution.
e40
It's a problem with the Cygwin openssh. If you use Putty's plink.exe, you can workaround the issue:http://www.cygwin.com/ml/cygwin/2009-12/msg01147.html
e40
A: 

Hi, I am using Windows XP and have followed the procedure as mentioned above. But I can not run git clone successfully. It keeps saying 'remote hung up unexpectedly'. I can connect the server using the user name and password using plink.exe and I have also set the GIT_SSH variable as mentioned above. But it does not help.

Please advise. Thanks, ~Ans

Ans
A: 

Check the openssh version you're using in CygWin. Version 5.5p1-1 (which is the latest at this time) gave me the same error. Downgrading to 5.4p1-1 fixed the problem.

Another solution would be to use putty/plink instead of openssh.

For more details, see this thread: http://www.mail-archive.com/[email protected]/msg103752.html

Gabriel Burca
+2  A: 

I found out that using ssh.exe from the Git package works every time, as opposed to the ssh that comes with cygwin (the default). Using this exported variable seems to help; it's slower (2x or more) but it's more stable. Take it as another workaround.

$ export GIT_SSH=/cygdrive/c/Program\ Files/Git/bin/ssh.exe

FYI: This version of Msysgit comes with OpenSSH 4.6p1, OpenSSL 0.9.8e. [works] Cygwin's SSH is OpenSSH 5.5p1, OpenSSL 0.9.8n. [doesn't work]

HTH, -Pat

PatC
A: 

I get message: "remote end gung-up, unexpected EOFs, index-pack failed" while cloning git repo but was able to workaround this issue with copssh http://sourceforge.net/projects/sereds/files/Copssh

The root cause is Cygwin openssh package.

I removed original openssh from Cygwin, installed copssh and set GIT_SSH variable to point copssh binaries. After this I simply added copssh binaries in the PATH and now I'm using copssh instead of openssh - there is no difference.

Everything works fine and issue does not appear any more.

Bartosz Firyn
A: 

If you want to try the cygwin openssh 5.4p1-1, which does seem to work for this, unlike 5.5 or 5.6, you can use the cygwin time machine mirrors. Start setup.exe with -X and add a mirror Url, such as:

ftp://www.fruitbat.org/pub/cygwin/circa/2010/05/20/230133

Be careful not to install too much, i.e. base packages, from an older mirror than the rest of your install.

eisd