无法从运行gitosis的我的雪豹服务器克隆gitosis-admin.git本地

我已经安装gitosis如下所述: http : //gist.github.com/264304

其中一个我必须调整的是让我的git用户使用ssh(我通过服务器pipe理 – >访问 – > ssh并添加了'git'用户)的权限。

当我从本地机器(mac osx)作为git用户ssh,我得到这个回应:

PTY allocation request failed on channel 0 bash: gitosis-serve: command not found Connection to 10.0.0.108 closed. 

我认为这是正常的,因为在Pro GIT中,作者说如果使用git用户尝试ssh到服务器,应该得到类似这样的东西:

 PTY allocation request failed on channel 0 fatal: unrecognized command 'gitosis-serve schacon@quaternion' Connection to gitserver closed. 

到目前为止,我想呢? 现在,当我尝试使用此命令克隆我的gitosis-admin.git存储库时:

 $git clone [email protected]:gitosis-admin.git 

我得到这个:

 Initialized empty Git repository in /Users/joggink/gitosis-admin/.git/ bash: gitosis-serve: command not found fatal: The remote end hung up unexpectedly 

所以在做了一些search之后,我在serverfault上find了一个答案,声称我应该使用ssh://作为我的git clone的协议(我认为这是默认的git协议?)但是,当我尝试:

 $git clone ssh://[email protected]:gitosis-admin.git 

这是回应:

 The authenticity of host ' (::1)' can't be established. RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '' (RSA) to the list of known hosts. Password: Password: Password: Permission denied (publickey,keyboard-interactive). fatal: The remote end hung up unexpectedly 

当我input自己的密码(因为我的git用户没有密码),我得到以下错误:

 The authenticity of host ' (::1)' can't be established. RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '' (RSA) to the list of known hosts. Password: bash: git-upload-pack: command not found fatal: The remote end hung up unexpectedly 

我添加了我的上传包位置如下:

 $git clone -u /usr/local/git/bin/git-upload-pack ssh://[email protected]:gitosis-admin.git 

我得到的错误,gitosis-admin.git不是一个git回购…

 Initialized empty Git repository in /Users/joggink/gitosis-admin/.git/ The authenticity of host ' (::1)' can't be established. RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '' (RSA) to the list of known hosts. Password: fatal: '[email protected]:gitosis-admin.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

我一直在寻找近一个星期的解决scheme,我在互联网上find的每个主题都没有结果。

我总是有同样的问题,找出原因有点棘手。 我尝试通过IP交换服务器名称:

git clone git @frontend1:gitosis-admin.git

通过

git clone [email protected]:gitosis-admin.git

并且得到了未findgitosis-serve的消息,也就是说,使用.ssh / authorized_keys调用gitosis-serve时,不包括/ usr / local / binpath。

因此,在文件〜git / .ssh / authorized_keys(作为admin)我通过/ usr / local / bin / gitosis-serve来交换gitosis-serve,即完整的path名。 之后,命令

git clone git @frontend1:gitosis-admin.git

工作得很好。

尝试将git用户shell从git-shell更改为sh
例如:

混帐:X:1000:1000 :: /家/ git的:在/ usr /斌/ git的壳

混帐:X:1000:1000 :: /家/的git:/ bin / sh的

这帮助了我。

当我尝试在Ubuntu Linux 10.04(lucid lynx)上安装gitosis时遇到了同样的问题。 我卸载gitosis,删除主目录(/ srv / gitosis /为我),并重新启动Ubuntu社区git页面上的说明 。 当我到达那一步时,问题不再发生。