带有 LDAP 的 Gitolite 不工作

标签 git ldap gitolite

我是 gitolite 的新手。我正在尝试用 gitolite 做一个非常简单的测试。我已经设置了名为“test_repo”的存储库。请注意,除了我在下面声明的内容之外,我没有修改任何其他内容。我可以在 gitweb 中看到这个 repo。这是 repo 配置

repo test_repo
    RW+     =   @all

现在我想克隆这个 repo。我有 ldap 访问服务器。根据我对@all 的理解,它应该允许我这样做。

当我发布

git clone git@myserver:repositories/test_repo.git 
#I know this is wrong. But I just wanted to test as the above did not work

git clone git@myserver:test_repo.git

它要求输入密码。我已遵循本指南 http://sharadchhetri.com/2013/05/31/how-to-create-own-git-server-with-gitolite-and-gitweb-in-ubuntu/ , 它没有为 git 用户设置密码

当我发出

git clone myname@myserver:test_repo.git

我收到以下错误

fatal: 'test_repo.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我也厌倦了克隆默认的 repo“test_repo.git”。但我遇到了同样的错误。

我也厌倦了这个

git clone myname@myserver:/home/git/repositories/testing.git

然后克隆就开始工作了。但是当我执行 git push -u origin master 一些修改过的文件时,我得到了

error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
! [remote rejected] master -> master (n/a (unpacker error))

注意:我没有在conf文件中添加任何用户

感谢任何帮助。

最佳答案

 git clone myname@myserver:/home/git/repositories/testing.git
  • 完全绕过gitolite,它不叫
  • 使用错误的帐户“myname”,该帐户无权读取 git 帐户文件夹。

应该起作用的是:

 git clone git@myserver:test_repo.git
 or
 git clone git@myserver/test_repo.git

你不应该指定 'repositories' 文件夹(gitolite 知道 repo 应该在哪里)

假设 ssh -Tvvv git@myserver 有效(即不询问密码)。
首先使 ssh 工作,然后再次尝试 git clone


正如我在评论中所说,LDAP ssh 都是身份验证机制,因此您可以使用或另一个,不能同时使用:

如果 ssh 有效,但克隆无效,那么您需要在 ~git/.gitolite/logs 中查看 gitolite 日志

I could not find anything useful in the log. Moreover I did a tail -f of the log file. Its not even updated when I try to clone.

这意味着问题出在 ssh 级别,没有正确调用 gitolite:这是在 ~git/.ssh/authorized_keys 中,如果您直接在其中手动添加 ssh key ,而不是通过 gitolite-admin 存储库的 keys 文件夹添加并将该存储库推送回 gitolite 服务器(这会触发上述 ~git/.ssh/authorized_keys 文件 的更新)。

I think that could be the reason. I have no idea what just happened. I can even clone gitolite-admin, in admin server (this was working earlier).
I will re install every thing (because I think I messed up a lot with config files by now).

关于带有 LDAP 的 Gitolite 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17990402/

相关文章:

windows - 系统准备服务器后 Git 远程不工作

git - 在 Git 中跟踪 Gitolite(常见)钩子(Hook)

git-svn 分支而不复制每个子目录

git - merge 具有不同历史的两个不同存储库

git - 由于 ECMDERR "Server aborted the SSL handshake",Bower 无法下载

java - 如何在部署 War 时进行数据库执行

git - 使用gitolite时如何重命名主分支

git - 如何将一个 Gitlab 项目复制到另一个 Gitlab 仓库?

php - 无法在 Ubuntu 18.10 上安装 php7.2-ldap - "unmet dependencies"

c# - 如何在 Active Directory 中找到具有 GUID(objectGUID) 参数的用户