无法使用非gitolite管理员用户访问gitolite回购站 [英] Cannot access gitolite repos with non-gitolite admin users

查看:216
本文介绍了无法使用非gitolite管理员用户访问gitolite回购站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu 12.04上安装了Gitolite 3.5.3。我创建了测试回购,我只能通过gitolite用户访问它,而不能通过ssh访问它。
我需要允许其他系统用户(用户1,用户,用户2)或用户组访问git(推,拉合并等)通过ssh这样:

  git clone user1@domain.com:megaproject 

但我尝试像这样连接:

  git clone user@domain.com:megaproject 

并为此用户输入正确的密码我得到:

 致命的:'megaproject'似乎不是一个git仓库
致命的:无法从远程仓库读取。
请确保您具有正确的访问权限
并存在存储库。

即使我创建了 keydir

我该如何改变以提供访问权限?


<您永远不会使用'用户'克隆/访问gitolite管理的回购。

您总是使用您使用的'git'帐户安装gitolite。



然后,Gitolite会通过在〜git / .ssh中查找用于此调用的公钥来推导出您实际上是谁/ authorized_keys文件



详情请参阅如何像gitolite这样的程序工作?。






如果你想访问一个gitolite管理的仓库不同的用户,您需要为这些用户提供正确的公钥/私钥,并在〜/ .ssh / config文件中引用私钥,如

 主机gitolite_as_user1 
HostName gitolite_server_name
User git
IdentityFile〜/ .ssh / user1

Host gitolite_as_user2 $ b $ HostName gitolite_server_name
User git
IdentityFile〜/ .ssh / user2

请注意,ssh网址为:

  ssh:// gitolite_as_user1:yourRepo 
ssh:// gitolite_as_user2:yourRepo

它会一直使用'git'帐户(但使用不同的公共ssh密钥)


I've installed Gitolite 3.5.3 on Ubuntu 12.04. I created test repo and I can access it over ssh only with gitolite user but not others. I need to allow access other system users (user1,user,user2) or usergroup to git(push, pull merge etc) over ssh like this:

git clone user1@domain.com:megaproject

But I try to connect like this:

git clone user@domain.com:megaproject

and write correct password for this user I get:

fatal: 'megaproject' 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.

Even if I create keydir directory in the home folder of gitolite user with my ssh public key - nothing changes.

What should I change to provide access in such a way?

解决方案

You never clone/access a gitolite-managed repo with a 'user'.
You always use the 'git' account that you used to install gitolite.

Gitolite will then deduce who you actually are by looking for the public key used for this call in the ~git/.ssh/authorized_keys file.

See more at "How do programs like gitolite work?".


If you want to access a gitolite-managed repo as different user, you need to have the right public/private keys for those users, and reference the private key in an ~/.ssh/config file, as shown in "users are asked for password while using gitolite".

Host gitolite_as_user1
    HostName gitolite_server_name
    User git
    IdentityFile ~/.ssh/user1

Host gitolite_as_user2
    HostName gitolite_server_name 
    User git
    IdentityFile ~/.ssh/user2

Note that the ssh url will be:

ssh://gitolite_as_user1:yourRepo
ssh://gitolite_as_user2:yourRepo

And it will always use the 'git' account (but with different public ssh keys)

这篇关于无法使用非gitolite管理员用户访问gitolite回购站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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