git Gitolite - 如何创建用户?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5618537/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Gitolite - How to create users?
提问by Zap
I tried to install git + gitolite following this manual- using root instalation from server. I just do not understand if new gitolite users have to have their user accounts?. When I add tester.pubkey into keydirfolder and configure access to some repository, git always ask for a password and do not allow me to clone anything
我尝试按照本手册安装 git + gitolite - 使用服务器的 root 安装。我只是不明白新的 gitolite 用户是否必须拥有他们的用户帐户?. 当我将tester.pub密钥添加到keydir文件夹并配置对某个存储库的访问权限时,git 总是要求输入密码并且不允许我克隆任何内容
git clone [email protected]:testrepo
Initialized empty Git repository in /home/testuser/git/testrepo/.git/
[email protected]'s password:
Permission denied (publickey,password).
fatal: The remote end hung up unexpectedly
I don't believe that create system account (adduser testuser) is neccessarry because gitolite should be installable and configurable even without root access onto server.
我不相信创建系统帐户(adduser testuser)是必要的,因为即使没有对服务器的 root 访问权限,gitolite 也应该是可安装和可配置的。
So could anybody please show me what I have misunderstood?
那么有人可以告诉我我误解了什么吗?
Thank you very much.
非常感谢。
EDIT:
编辑:
Well... I reinstall gitolite using client instalation transcript. Now adding and pushing new pub keys successfully changes ~/.ssh/authorized_keys for my gituser on server. So it seems better than my first try. But I still can not clone any repozitory from another place. When I try to add pub key + edit config for my windows PC with msysgit, then try
嗯...我使用客户端安装成绩单重新安装 gitolite 。现在添加和推送新的 pub 密钥成功更改了服务器上我的git用户的~/.ssh/authorized_keys 。所以这似乎比我的第一次尝试要好。但我仍然无法从另一个地方克隆任何存储库。当我尝试使用 msysgit 为我的 Windows PC 添加 pub 密钥 + 编辑配置时,然后尝试
$ git clone [email protected]:project.git
cloning into project...
Fatal ERROR: unable to authenticate
Fatal: the remote end hung up unexpectedly
On other hand when try another linux, it still request for password.
另一方面,当尝试另一个 linux 时,它仍然要求输入密码。
# git clone [email protected]:project.git
Cloning into project...
[email protected]'s password:
Even when I provide password for git user:
fatal: 'project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
# git clone [email protected]:project.git
Cloning into project...
[email protected]'s password:
即使我为 git 用户提供密码:
fatal: 'project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
This was probably caused by broaken system account.
这可能是由于系统帐户损坏引起的。
Now I really dont know what to do - should I create somehow .ssh/config on each client to make it work?
现在我真的不知道该怎么做 - 我应该在每个客户端上以某种方式创建 .ssh/config 以使其工作吗?
Now I am starting to be little bit annoyed and upset and I will probably remove all and try mercurial:-D Except someone could help me:) Thank you.
现在我开始有点生气和不安,我可能会删除所有并尝试 mercurial:-D 除非有人可以帮助我:) 谢谢。
回答by arulraj.net
Yes thats the problem... me too faced the same.. i created the public key using puttygen ssh2-rsa format gitolite does not accept this. You need to convert to openssh
是的,这就是问题......我也面临同样的问题......我使用 puttygen ssh2-rsa 格式创建了公钥,gitolite 不接受这个。你需要转换成openssh
ssh-keygen -i -f yourname.pub > yourname_openssh.pub
ssh-keygen -i -f yourname.pub > yourname_openssh.pub
Now use this converted public key
现在使用这个转换后的公钥
回答by VonC
There is no 'keydata
' folder, only 'keydir
' and 'conf
' (as mentioned in the documentation).
没有“ keydata
”文件夹,只有“ keydir
”和“ conf
”(如文档中所述)。
If you have cloned locally the gitolite-admin
repo (git clone gitolite@server:gitolite-admin
), you need to:
如果您在本地克隆了gitolite-admin
repo ( git clone gitolite@server:gitolite-admin
),则需要:
- add your new public key named after the user in the
keydir
repo:username.pub
- add that same username in one of the user groups in
conf/gitolite.conf
- push back the new modifications to the gitolite server (there is a special hook on the
gitolite-admin
repo which will add the new public key to the~/.ssh/authorized_keys
file).
- 在存储库中添加以用户命名的新公钥
keydir
:username.pub
- 在用户组之一中添加相同的用户名
conf/gitolite.conf
- 将新的修改推回 gitolite 服务器(
gitolite-admin
repo上有一个特殊的钩子,可以将新的公钥添加到~/.ssh/authorized_keys
文件中)。
回答by Zap
I solved msysgit problem.
我解决了 msysgit 问题。
- I reinsall msysgit and use OPENSSH instead of PUTTY (it is recommended in install manual of gitolite - but I had msysgit installed before)
- when generating ssh-key, it musthave default name id_rsaotherwise it did not work for me
- 我重新安装了 msysgit 并使用 OPENSSH 而不是 PUTTY(在 gitolite 安装手册中推荐 - 但我之前安装了 msysgit)
- 生成 ssh-key 时,它必须有默认名称id_rsa否则它对我不起作用
Because I always had custom name for key, I can not say if step 1 is neccessary and I won't try it again:) Now I can clone/commit/push - finally.
因为我总是有自定义的密钥名称,所以我不能说第 1 步是否必要,我不会再试一次:) 现在我可以克隆/提交/推送 - 最后。
Special thanx to VonC for his patience
特别感谢 VonC 的耐心