1

我正在部署 Rails 应用程序。

我在我的服务器上设置了 Gitosis。Git 用户已启动,我已经在服务器上拥有“部署”用户!我从服务器上的部署用户“git clone”到我的本地机器。设置 Gitosis 后,我还可以从服务器(git 用户)“git clone”。

我想要的是从“git”用户到“部署”用户从服务器内部的“git clone”“git clone”!

这里是图片中问题。

我已经知道这个问题出在 ssh 权限等方面,因为当我尝试在部署用户上“git clone”时,我得到了

Initialized empty Git repository in /home/deploy/some_folder/.git/
The authenticity of host '[178.xx.xx.xx]:30000 ([178.xx.xx.xx]:30000)' can't be established. 
RSA key fingerprint is dc:f3:53:35:xx:xx:xx:f7:62:4c:e3:68:7e:70:46:cb. 
Are you sure you want to continue connecting (yes/no)? ( MY ANSWER yes )
Failed to add the host to the list of known hosts (/home/deploy/.ssh/known_hosts). 
git@178.xx.xx.xx's password:

请让我知道我必须做些什么来解决这个问题!

提前致谢!

4

1 回答 1

2

这可能不是 git 问题,而是 ssh 问题。您应该能够通过尝试 ssh 到 git 服务器(即 localhost)来复制相同的问题。很可能文件夹 ~/.ssh(或 ~/.ssh/known_hosts)权限不正确(磁盘可能已满,或者也可能存在一些文件系统损坏,但这些可能性极小)。

如果那里没有任何重要数据,可以尝试删除 ~/.ssh,并让 ssh 在下次 ssh(或 git)尝试访问 localhost 时重建它。


话虽如此,我现在记得 gitosis 使用证书进行用户身份验证。您的 .ssh 应该有一个 id_rsa 和 id_rsa.pub。如果它们保存在本地主机中,请确保保存它们。

还要确保您已将部署用户的证书注册到 gitosis,并允许访问 gitosis.conf 中的存储库。要求密码的 ssh 阶段意味着您的私钥由于某种原因未用于身份验证。

于 2010-07-26T09:45:24.273 回答