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

12,202

Solution 1

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.

Solution 2

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.

Share:
12,202
Premjith
Author by

Premjith

Updated on June 05, 2022

Comments

  • Premjith
    Premjith almost 2 years

    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.