与LDAP不起作用的Gitolite [英] Gitolite with LDAP not working

查看:126
本文介绍了与LDAP不起作用的Gitolite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对gitolite很陌生。我正在试图用gitolite做一个非常简单的测试。我已经建立了名为test_repo的存储库。请注意,除了我在下面陈述的内容外,我没有修改任何其他内容。我可以在gitweb中看到这个回购。这是回购配置

  repo test_repo 
RW + = @all

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



当我发行时

  git clone git @ myserver:repositories / test_repo.git 
#我知道这是错误的。但我只是想测试,因为上面没有工作

  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



我收到以下错误:

 致命:'test_repo.git'似乎不是git存储库
致命:无法从远程存储库读取。

请确保您拥有正确的访问权限
并存在存储库。

我也厌倦了克隆默认回购test_repo.git。但我收到了同样的错误。



我也厌倦了这个

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

克隆工作正常。但是,当我做 git push -u origin master 一些修改过的文件我得到了

 错误:将对象添加到存储库数据库的权限不足./objects 
致命:未能写入对象
错误:解包失败:解包对象异常退出
! [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 

    git clone git @ myserver /test_repo.git

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



    假设 ssh -Tvvv git @ myserver 可以工作(即不要求输入密码)。

    先让ssh工作,然后再试一次 git clone






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





    如果ssh有效,但克隆不起作用,那么你需要看一下gitolite日志〜git / .gitolite / logs


    我在日志中找不到任何有用的东西。此外,我做了一个 tail -f 的日志文件。它甚至没有更新,当我尝试克隆。


    这意味着问题是在ssh级别,不正确调用gitolite 〜git / .ssh / authorized_keys ,如果直接在其中手动添加ssh密钥,则会发生,而不是通过 gitolite-admin 回购的文件夹,并将该回购推回给gitolite服务器所述〜git / .ssh / authorized_keys文件的更新)。


    我认为这可能是原因。我不知道刚刚发生了什么。我甚至可以在管理服务器中克隆 gitolite-admin (这在早期工作)。

    我将重新安装每一件事情(因为我认为我搞砸了现在配置文件增加了很多)。



    I am new to gitolite. I am trying to do a very simple test with gitolite. I have setup my repository called "test_repo". Please note that I have not modified anything else otherthan what I have stated below. I can see this repo in gitweb. This is the repo configuration

    repo test_repo
        RW+     =   @all
    

    Now I want to clone this repo. I have ldap access to server. By my understanding of @all, it should allow me to do this.

    when I issue

    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
    

    or

    git clone git@myserver:test_repo.git
    

    its asking for password. I have followed this guide http://sharadchhetri.com/2013/05/31/how-to-create-own-git-server-with-gitolite-and-gitweb-in-ubuntu/, which does not set a password for git user

    When I issue

    git clone myname@myserver:test_repo.git

    I am getting the following error

    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.
    

    I also tired to clone the default repo "test_repo.git". But I am getting the same error.

    I also tired this

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

    then cloning is working. But when I do git push -u origin master some modified files I am getting

    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))
    

    Note: I have not added any user in conf file

    Any help is appreciated.

    解决方案

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

    • that completely bypass gitolite, which isn't called
    • use the wrong account 'myname' which has no right to read the git account folders.

    What should work is:

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

    You shouldn't specify the 'repositories' folder (gitolite knows where the repo is supposed to be)

    That supposes that ssh -Tvvv git@myserver works (ie do not ask password).
    Make that ssh work first, and then try again the git clone.


    As I say in the comment, LDAP and ssh are both authentication mechanism, so you can use one or the other, not both:

    If the ssh works, but the clone doesn't work, then you need to have a look in the gitolite logs at ~git/.gitolite/logs

    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.

    That means the issue is on the ssh level, not calling properly gitolite: that is in ~git/.ssh/authorized_keys, and happens if you add an ssh key manually directly in it, instead of adding through the keys folder of the gitolite-admin repo and pushing back that repo to the gitolite server (which triggers the update of said ~git/.ssh/authorized_keys file).

    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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆