How to config SSH for gitlab?

北战南征 提交于 2019-12-03 09:57:28

问题


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.

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


回答1:


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 

Hence you should use git@gitlabhost.com

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

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"

so that git can uniquely identify each user.




回答2:


In my experience, I had to connect to the gitlab server, as the git user, and modify the authenticated_keys file, as it was filled with a bunch of random #'s. after clearing that, I added my SSH key in the GitLab GUI and was able to clone and push normally.

Hope that helps.



来源:https://stackoverflow.com/questions/18472473/how-to-config-ssh-for-gitlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!