克隆 repo 时出现 Gitlab/Gitolite 问题 [英] Gitlab/Gitolite issue while cloning repo

查看:25
本文介绍了克隆 repo 时出现 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.

但是当我尝试克隆新创建的项目 repo 时

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

在我从 gitlab Web 控制台添加 ssh 密钥后,authorized_keys 文件中是否应该有我的用户密钥?伙计们,我做错了什么?

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?

推荐答案

好的,我想我明白了.

当我从网络界面为用户添加密钥时,它还没有被添加到 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.

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

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