Windows环境下有人用winsshd或freesshd配置成功过ssh协议的Git server么?

571 views
Skip to first unread message

ts

unread,
Nov 11, 2011, 12:29:51 PM11/11/11
to got...@googlegroups.com
正在配置一个支持ssh协议的Git server,尝试了一下freesshd和winsshd,
感觉这两个工具比较轻一些,相对cygwin+opensshd或者copsshd。

但目前是不管怎样都无法配置成功,git clone等命令会通过ssh协议执行一些命令,
这些命令在cmd.exe下无法执行成功,freesshd下错误为:

c:\>git clone ssh://u...@10.12.34.56/testrepo.git test
Cloning into test...
u...@10.12.34.56's password:
fatal: protocol error: bad line length character: fata


winsshd下log中的错误是:
"Session channel 1: 
Executed command 'git-upload-pack '/d/testgit'' in working directory 
'D:\testgit'."

感觉是command shell的问题,换了一下git自带的bash.exe,也没什么变化。

挺好奇不知道有没有人曾经配置成功过?我猜测可能是个死胡同。

copsshd和cygwin+opensshd下面网上很多成功的例子,要求系统注册新用户,
但domain authentication配置似乎很不方便,没前面两个直接简明。




ts

unread,
Nov 11, 2011, 12:32:28 PM11/11/11
to got...@googlegroups.com
另外,用cygwin或copsshd 的方案,会读HOME环境变量的值,这一点和Eclipse的EGit插件设置有些冲突。

再就是,copsshd的一些版本似乎也挑git的版本,这样的话,可能导致git client和git server上的git版本不同,总觉得是个隐患。

2011/11/12 ts <tanner...@gmail.com>

ts

unread,
Nov 11, 2011, 12:43:33 PM11/11/11
to got...@googlegroups.com
手动通过ssh执行
ssh u...@10.12.34.56/  git upload-pack c:/usr/testrepo.git
u...@10.12.34.56's password:
009b4282f85b7f7724bb5086e91284479b6f497b4e8d HEAD multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag multi_ack_detailed
003f4282f85b7f7724bb5086e91284479b6f497b4e8d refs/heads/master
00000000
不管是freesshd还是winsshd都能得到如上正确结果的。

执行git ls-remote就不行了
git ls-remote ssh://u...@10.12.34.56/c:/usr/testrepo.git
u...@10.12.34.56's password:
fatal: protocol error: bad line length character: fata

所以猜测这个问题还是与git有关,现在不知道git 通过ssh执行的命令到底是哪些,没找到能设置log或trace的地方,只好先这么猜着。


ts

unread,
Nov 11, 2011, 12:46:17 PM11/11/11
to got...@googlegroups.com
msysgit和stackoverflow上找了一阵子,没看到解决方案或不行的原因分析,发过来请方家指点。

Jiang Xin

unread,
Nov 11, 2011, 8:24:12 PM11/11/11
to GotGit
freesshd,winsshd,copsshd 都没有用过。周三回北京后再仔细研究一下。
cygwin 的 openssh 客户端不稳定,不知道做服务器端如何?


On Nov 12, 1:46 am, ts <tanner.se...@gmail.com> wrote:
> 在msysgit和stackoverflow上找了一阵子,没看到解决方案或不行的原因分析,发过来请方家指点。

tanner

unread,
Nov 12, 2011, 7:45:47 AM11/12/11
to GotGit
cygwin+opensshd就我这几天测试情况看还算稳定(我也就手动测了常用的一些命令),今天把copssh服务器也配起来了,做为预案吧呵
呵。

昨天提到的
"用cygwin或copsshd 的方案,会读HOME环境变量的值,这一点和Eclipse的EGit插件设置有些冲突。"
以及


"copsshd的一些版本似乎也挑git的版本,这样的话,可能导致git client和git server上的git版本不同,总觉得是个隐
患"

今天找干净的机器重新试了一下,都是伪问题。
目前这两个方案的缺点是配置域用户验证还是略嫌麻烦(copsshd还会不稳定)。

平常心

unread,
Dec 20, 2011, 8:32:59 PM12/20/11
to GotGit
可以的
详细可以参照
http://holyhoehle.wordpress.com/2011/08/05/setting-up-a-git-server-on-windows-server-2008-r2-using-msysgit-and-winsshd-update/

On 11月12日, 上午1时29分, ts <tanner.se...@gmail.com> wrote:
> 正在配置一个支持ssh协议的Git server,尝试了一下freesshd和winsshd,
> 感觉这两个工具比较轻一些,相对cygwin+opensshd或者copsshd。
>
> 但目前是不管怎样都无法配置成功,git clone等命令会通过ssh协议执行一些命令,
> 这些命令在cmd.exe下无法执行成功,freesshd下错误为:
>

> *c:\>git clone ssh://...@10.12.34.56/testrepo.git test*
> *Cloning into test...*
> *...@10.12.34.56's password:*
> *fatal: protocol error: bad line length character: fata*
>
> winsshd下log中的错误是:
> *"Session channel 1:


> Executed command 'git-upload-pack '/d/testgit'' in working directory

> 'D:\testgit'."*

Reply all
Reply to author
Forward
0 new messages