Gitolite 与 LDAP 不工作 [英] Gitolite with LDAP not working
问题描述
我是 gitolite 的新手.我正在尝试用 gitolite 做一个非常简单的测试.我已经设置了名为test_repo"的存储库.请注意,除了我在下面说明的内容之外,我没有修改任何其他内容.我可以在 gitweb 中看到这个 repo.这是repo配置
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
现在我想克隆这个 repo.我有对服务器的 ldap 访问权限.根据我对@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.
当我发布时
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用户设置密码
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
当我发布时
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.
我也厌倦了克隆默认存储库test_repo.git".但我遇到了同样的错误.
I also tired to clone the default repo "test_repo.git". But I am getting the same error.
这个我也累了
git clone myname@myserver:/home/git/repositories/testing.git
然后克隆正在工作.但是当我做 git push -u origin master
一些修改过的文件时,我得到了
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))
注意:我没有在conf文件中添加任何用户
Note: I have not added any user in conf file
感谢任何帮助.
推荐答案
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应该在哪里)
You shouldn't specify the 'repositories' folder (gitolite knows where the repo is supposed to be)
假设 ssh -Tvvv git@myserver
有效(即不询问密码).
先让 ssh 工作,然后再试一次 git clone
.
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
.
正如我在评论中所说,LDAP 和 ssh 都是身份验证机制,因此您可以使用一个或另一个,而不是两者:
As I say in the comment, LDAP and ssh are both authentication mechanism, so you can use one or the other, not both:
- Https + LDAP + gitolite:在此处查看示例.
- 或 SSH + gitolite
如果 ssh 有效,但克隆无效,那么您需要查看 ~git/.gitolite/logs
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
我在日志中找不到任何有用的信息.此外,我对日志文件做了一个 tail -f
.当我尝试克隆时,它甚至没有更新.
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 密钥,而不是通过 gitolite-admin
存储库的 keys
文件夹添加并将该存储库推回 gitolite 服务器(这会触发所述 ~git/.ssh/authorized_keys 文件
的更新).
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
).
我认为这可能是原因.我不知道刚刚发生了什么.我什至可以在管理服务器中克隆 gitolite-admin
(这是之前的工作).
我会重新安装所有东西(因为我觉得我现在把配置文件搞砸了).
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).
这篇关于Gitolite 与 LDAP 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!