Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab: I can't push or clone repo, asking for Git password

I have installed latest GitLab with Bitnami. But I can't push my updates to central repo. It always asks for Git password. I installed it in a local server and given the domain name as a local IP. The public keys are updated in /hom/git/.ssh/authorised_keys list. Iut it asks for Git user password. Please, help me.

like image 346
Premjith Avatar asked Apr 12 '13 14:04

Premjith


2 Answers

it is strange. Could you check that your SSH server is configured to use authorized_keys files?

/etc/ssh/sshd_config

PubkeyAuthentication yes

Could you check the file permissions for the .ssh/authorized_keys file? The owner should be the git user. Did you already have a Gitlab version installed before? Maybe Gitolite is already installed and you need to use gitlab-shell for GitLab 5.

like image 57
Beltran Avatar answered Oct 28 '22 11:10

Beltran


I assumed that your git command is something like this

 git clone git@domain:project.git

or maybe

 sudo git clone git@domain:project.git

Sometimes we get mixed up with the user account that we are using. If we run sudo, that means the command is being run as root. And did you create the SSH key for root and put it in Gitlab? In other case you probably created the SSH key using sudo ssh-keygen but you run git normally, meaning the git command is running as the active user.

We may also get mixed up with the SSH key that we put inside Gitlab.

Not sure if you need this yet, but if you use web hook, in Ubuntu the Apache is normally running as www-data. So for web hook to work, you would need to create SSH key for the www-data user.

like image 29
Iszuddin Ismail Avatar answered Oct 28 '22 12:10

Iszuddin Ismail