Twoez
Twoez

Reputation: 548

Password prompt when pushing git repository on localhost (gitlab)

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.

Upvotes: 2

Views: 4025

Answers (1)

virtualmarc
virtualmarc

Reputation: 543

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

Upvotes: 1

Related Questions