如何为gitlab配置SSH? [英] How to config SSH for gitlab?

查看:110
本文介绍了如何为gitlab配置SSH?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我在Github上的经验,我坚决需要与我的用户(如user@gitlabhost.com)克隆存储库.但是,当我尝试此操作时,它无法识别来自gitlab的密码.只有使用gitlab用户进行克隆才有效.

In my experience of Github, I tought that I need to clone a repository with my user like user@gitlabhost.com. But when I try this, then it does not recognize my password from gitlab. Only cloning with gitlab user does work.

有人可以帮助我吗??? -我必须如何配置gitlab访问权限?

Can anybody please help me??? - How do I have to configure gitlab access right?

推荐答案

如果您遵循gitlab的安装说明,则必须已将其安装在名为git的用户下的linux框中.通常在这样的文件夹中

If you followed Installation Instructions of gitlab, then you must have installed it on an linux box under the user named git. Typically in a folder like this

/home/git/gitlab 

因此,您应该使用git@gitlabhost.com

我不确定配置SSH"的含义.但是由于期望每个用户都使用自己的密钥对,因此使用常规git命令访问gitlab管理的存储库应该没有问题.以下两个都应该起作用

I am not sure what you mean by "configuring SSH". But since each user is expected to use her own keypair, there should be no problem in accessing gitlab managed repo's using normal git commands. Both the following should work

git clone ssh://git@gitlabhost.com/group/repo.git
git clone git@gitlabhost.com:group/repo.git

每个用户必须使用以下命令设置自己的git身份(在本地计算机上)

Each user must have set their own git identity (on their local machines) using

git config --global user.name "elitmus"
git config --global user.email "abc@gmail.com"

以便git可以唯一标识每个用户.

so that git can uniquely identify each user.

这篇关于如何为gitlab配置SSH?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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