Gitolite - 如何创建用户?

发布于 2024-10-31 09:52:25 字数 2298 浏览 1 评论 0原文

我尝试按照本手册安装 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

我不相信的 内容创建系统帐户(adduser testuser)是必要的,因为即使没有服务器的 root 访问权限,gitolite 也应该是可安装和可配置的。

那么有人可以告诉我我误解了什么吗?

非常感谢。


编辑:

嗯...我使用客户端安装重新安装 gitolite 转录。现在,添加并推送新的发布密钥成功更改了服务器上我的 git 用户的 ~/.ssh/authorized_keys 。所以这看起来比我第一次尝试要好。 但我仍然无法从另一个地方克隆任何存储库。 当我尝试使用 msysgit 为我的 Windows PC 添加 pub key + 编辑配置时,然后尝试

$ git clone [email protected]:project.git
cloning into project...
Fatal ERROR: unable to authenticate
Fatal: the remote end hung up unexpectedly

另一方面,当尝试另一个Linux时,它仍然要求输入密码。

# 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

这可能是由损坏的系统帐户引起的。

现在我真的不知道该怎么办 - 我应该在每个客户端上以某种方式创建 .ssh/config 才能使其工作吗?

现在我开始有点恼火和不安,我可能会删除所有内容并尝试 Mercurial:-D 除非有人可以帮助我:)谢谢。

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.pub key into keydir folder and configure access to some repository, git always ask for a password and do not allow me to clone anything

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.

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 git user 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

$ 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.

# 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

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?

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

平定天下 2024-11-07 09:52:25

是的,这就是问题...我也面临着同样的问题..我使用 puttygen ssh2-rsa 格式创建了公钥,gitolite 不接受这一点。您需要转换为 openssh

ssh-keygen -i -f yourname.pub > yourname_openssh.pub

现在使用这个转换后的公钥

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

ssh-keygen -i -f yourname.pub > yourname_openssh.pub

Now use this converted public key

吹梦到西洲 2024-11-07 09:52:25

没有“keydata”文件夹,只有“keydir”和“conf”(如前所述文档中)。

如果您已在本地克隆了 gitolite-admin 存储库 (git clone gitolite@server:gitolite-admin),您需要:

  • 添加以用户命名的新公钥keydir 存储库:username.pub
  • conf/gitolite.conf 的用户组之一中添加相同的用户名,
  • 将新的修改推送回gitolite 服务器(gitolite-admin 存储库上有一个特殊的挂钩,它将新的公钥添加到 ~/.ssh/authorized_keys 文件中)。

There is no 'keydata' folder, only 'keydir' and 'conf' (as mentioned in the documentation).

If you have cloned locally the gitolite-admin repo (git clone gitolite@server:gitolite-admin), you need to:

  • 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).
ま柒月 2024-11-07 09:52:25

我解决了 msysgit 问题。

  1. 我重新安装 msysgit 并使用 OPENSSH 而不是 PUTTY (gitolite 安装手册中推荐 - 但我之前安装了 msysgit)
  2. 生成 ssh-key 时,它必须有默认名称id_rsa 否则它对我不起作用

因为我总是有自定义的密钥名称,我不能说步骤 1 是否必要,我不会再尝试:) 现在我可以克隆/提交/推送 - 最后。

特别感谢 VonC 的耐心等待

I solved msysgit problem.

  1. I reinsall msysgit and use OPENSSH instead of PUTTY (it is recommended in install manual of gitolite - but I had msysgit installed before)
  2. when generating ssh-key, it must have default name id_rsa otherwise it did not work for me

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.

Special thanx to VonC for his patience

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文