开发者

Can't push to ssh based git repository

I'm att开发者_StackOverflowempting to push to a repository over SSH instead of the normal https or whatever the default is. This process requires a username and password instead of an ssh key. However this always fails when I try to do this:

Owner@DESKTOP /w/programming/wreckcreations-site/dev (dev)
$ git push -vvv --all ssh://*name*@*site*/~/html/dev2
Pushing to ssh://*name*@*site*/~/html/dev2
fatal: The remote end hung up unexpectedly

Thinking it was an SSH issue, I tried to SSH into my local server

Owner@DESKTOP /w/programming/wreckcreations-site/dev (dev)
$ "`echo $GIT_SSH`" 192.168.2.2
login as: root
root@192.168.2.2's password:
Last login: Thu Nov 18 19:36:58 2010 from 192.168.2.4
←]0;root@system:~[root@system ~]# exit
logout
←[H←[2J
Owner@DESKTOP /w/programming/wreckcreations-site/dev (dev)
$ git push -vvv --all ssh://root@192.168.2.2/~/somedir
Pushing to ssh://root@192.168.2.2/~/somedir
fatal: The remote end hung up unexpectedly

Same error message... So I looked in /var/log/secure on the box

Nov 18 21:15:06 system sshd[28460]: Accepted password for root from 192.168.2.4 port 2788 ssh2
Nov 18 21:15:06 system sshd[28460]: pam_unix(sshd:session): session opened for user root by (uid=0)
Nov 18 21:15:11 system sshd[28460]: pam_unix(sshd:session): session closed for user root
Nov 18 21:17:35 system sshd[28618]: Received disconnect from 192.168.2.4: 13: Unable to authenticate

The first three lines are from plink, the last one is from git. The last line can be repeated every time I try to use git push. Which makes no sense

If I assume that my remote host is getting the same error message, why isn't git submitting my username and just disconnecting? I've never seen this kind of error before, so I'm really confused.

It should be noted that this is a Windows XP box using msysgit with both remote servers being Linux.

Any suggestions?


To use plink with git, you must do private key authentication. See this or this for instructions.


Apparently Plink just doesn't work this way with git, so I switched back to ssh. After many days of pain trying to get ssh and git to just work in Windows (hit the infamous "Unprotected key file!" error, ssh process randomly hanging, non-standard (and not working) private and public keys generated by Putty, multiple reinstalls, dragging of cygwin binaries and DLL files into git, etc), I successfully pushed to the remote server.

I would highly recommend not attempting this if your on Windows, as the process is just too time consuming and frustrating. I am myself seeking alternative solutions so I don't have to do this all over again when I do a reformat or move to a new computer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜