Gitlab / Gitolite问题,同时克隆回购 [英] Gitlab/Gitolite issue while cloning repo

查看:138
本文介绍了Gitlab / Gitolite问题,同时克隆回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经严格按照手册从gitlab wiki 。有用。我有一个网络访问,我也可以创建一个项目(并且之后创建了git repo)。一切正常。

I have setup a Gitlab strictly according to manual from the gitlab wiki. It works. I have a web access, I can create a project too (and git repo has been created after it). All is ok.

但是,当我尝试克隆新创建的项目回购时,

But when I try clone the newly created project repo with

git clone git@git.myserver.com:myproject.git

机器服务器说我需要为 git 用户输入密码(该用户没有密码)。我认为应该使用我提供的密钥授权我。

from the my development machine the server says that I need to enter password for the git user (this user have no password). I think it should auth me with key I provided.

我的环境:我已经在我的开发机器上成功创建了ssh密钥,将 HOME 环境变量到C:\ Users \。 Ssh使用其他服务器的密钥(以及此服务器)正确授权用户。
还为我的 git 用户添加了生成的密钥。

My environment: I've successfully created the ssh keys on my dev machine, set the HOME environment variable to C:\Users\. Ssh is correctly authorize user with keys to other servers (and to this server too). Also I've added the generated keys for my git user.

下一个命令也可以从本地服务器用户(这也是根据手册):

Next command is also working fine from the local server user (this is according to manual too):

sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin

git用户的 authorized_keys 文件是如:

My authorized_keys file for the git user is like:

# gitolite start
command="/home/git/bin/gl-auth-command gitlab",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa <LONG_KEY_HERE> gitlab@odiszapc
# gitolite end

如果 authorized_keys 文件后,我已经从gitlab web控制台添加ssh密钥?伙计们,我做错了什么?

Should there be my user key in the authorized_keys file after I've added ssh key from gitlab web console? Guys, what I'm doing wrong?

推荐答案

好吧,我想我已经明白了。

Okay, I think I've got it.

当我通过网页界面为用户添加密钥时,它尚未添加到 authorized_keys 文件中。我所做的是完全删除gitolite安装,然后根据本地手册从 gitolite wiki 。现在,当我向用户添加密钥时,此密钥将添加到 authorized_keys ,并且现在一切正常。

When I add key for the user from web interface, it hasn't been added to authorized_keys file. What I do is make full delete of the gitolite installation and then reinstall it according to native manual from the gitolite wiki. Now when i've add a key to user, this key is added to authorized_keys and all works fine now.

这篇关于Gitlab / Gitolite问题,同时克隆回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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