Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to config SSH for gitlab?

Tags:

git-clone

ssh

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?

like image 632
user2451418 Avatar asked Aug 27 '13 17:08

user2451418


People also ask

How do I access GitLab via SSH?

Creating SSH Key Step 2 − Now login to your GitLab account and click on the Settings option. Step 3 − To create SSH key, click on the SSH keys tab at left side of the menu. Step 4 − Now go to C drive, you will see the file with . pub extension which was generated in the first step.

Do I need SSH key for GitLab?

In order to communicate over SSH (Secure Shell), you must have an SSH key pair. Each SSH key pair has a public and a private key.


2 Answers

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.

like image 129
Litmus Avatar answered Sep 28 '22 16:09

Litmus


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.

like image 33
Eric Steinborn Avatar answered Sep 28 '22 18:09

Eric Steinborn