2

I just installed gitlab and followed this official guide: https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md

On the same server as where I installed git(lab) I am trying to create a repository by doing the following:

su git (i started by logging in with the git user)
cd /home/git/repositories
mkdir test-project
cd test-project
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@mydomain:root/test-project.git
git push -u origin master

But when I enter the last line a password is prompted for user git@mydomain.com.

Also when I enter

ssh -T git@localhost
or
ssh -T git@mydomain.com
I get a password prompted.

I've been trying loads of possible solution written on the internet but none seems to work.

Thanks for the help in advance.

Twoez
  • 540
  • 1
  • 5
  • 17
  • 1
    possible duplicate of [GitLab requires git@localhost password to push to a repo](http://stackoverflow.com/questions/11767366/gitlab-requires-gitlocalhost-password-to-push-to-a-repo) – Ciro Santilli OurBigBook.com Jan 10 '14 at 20:43

1 Answers1

1

Looks like this user does not have an ssh private key file in ~/.ssh/ (~ represents the home directory of your user) with the name id_rsa or the public key is not added to gitlab.

If the SSH Key is at another location you can create a file called config in ~/.ssh/ How to use the config file can be read here: http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/

If the key exists, check it's permissions. It has to be owned by the user (in your case: git) and needs to have the permissions (chmod) 600

virtualmarc
  • 533
  • 1
  • 4
  • 16
  • Thanks your idea was the solution. I didn't expect my user to be needing a ssh-key aswell since I was working locally. Adding a key worked. – Twoez Aug 29 '13 at 10:45