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

Also when I enter

ssh -T git@localhost
or
ssh -T [email protected]
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.

1

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.