How to config SSH for gitlab?

user2451418 picture user2451418 · Aug 27, 2013 · Viewed 60k times · Source

In my experience of Github, I tought that I need to clone a repository with my user like [email protected]. 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?

Answer

Litmus picture Litmus · Sep 18, 2013

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 [email protected]

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://[email protected]/group/repo.git
git clone [email protected]: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 "[email protected]"

so that git can uniquely identify each user.