GitLab requires git@localhost password to push to a repo

前端 未结 15 1812
梦毁少年i
梦毁少年i 2020-12-30 03:38

I\'m trying to get GitLab up and running on my server. I followed the installation instructions at the gitlab github page and everything went well.

The issue is, whe

相关标签:
15条回答
  • 2020-12-30 04:00

    This means that the gitlab ssh server was not properly configured.

    Edit /etc/ssh/sshd_config and assure that:

    PasswordAuthentication no
    ChallengeResponseAuthentication no
    

    This should enforce ssh key only logins which is also a good security measures. Many newer distros do already have this enabled by default.

    Don't ask me if you get locked outside, clearly SO is not the place where to ask how to configure and use a private/public key pair.

    0 讨论(0)
  • 2020-12-30 04:03

    If the installation went well, that means your gitlab is able to clone the gitolite-admin repo without issue.
    But you say it passes the status check, which means you are using, for ssh connection, an account named 'gitlab'.

    That also means that any client will have to ssh with that same account 'gitlab', not 'git'.
    So if your ssh key has been added through the gitlab interface, then you can git clone/git push to a remote name origin which would have the address 'gitlab@server'

    To debug some more, check out some other tips mentioned in "Setup Git Remote SSH (git-upload-pack / git-receive-pack)":

    If you cannot push locally (on the server itself, that is on 'localhost'), try at least a:

    ssh -vvvT gitlab@localhost
    

    It shouldn't require any password, since /home/gitlab/.ssh/id_rsa and /home/gitlab/.ssh/id_rsa.pub both exist.

    0 讨论(0)
  • 2020-12-30 04:05

    on the git server edit /etc/ssh/sshd_config

    uncomment the following lines under the authentication section or add them:

    PubkeyAuthentication yes

    AuthorizedKeysFile %h/.ssh/authorized_keys

    give your server a power cycle and then fire up gitlab

    0 讨论(0)
  • 2020-12-30 04:06

    I received the same password prompt. My issue was that I had restricted ssh usage to only a couple of users. I added the git user to the AllowUsers list sshd_config, and everything worked great.

    0 讨论(0)
  • 2020-12-30 04:07

    This started happening to me quite a lot lately - for work projects git would ask me my email and password. When entered it continues ok but it's annoying.

    I can fix this for any given application that I have access to with:

    git config remote.origin.url git@github.com:user_org_or_co/repo_name_itself
    

    e.g.

    git config remote.origin.url git@github.com:smithw/bookmarkapp
    
    0 讨论(0)
  • 2020-12-30 04:07

    Your git and gitlab users are passwordless?

    How the sshd_config is?

    check if this line is in the file: PermitEMptyPassword Yes

    Anyway I guess it unsafe, in my installation, I put this 'Yes', clone and then keep the old config... When Cloning the ssh_key is saved by user git, and it will not ask password anymore..

    But by now, i run into another error, when Im going to push, for every new User, we have to reconfig ssh for permit empty push and then keep back the config.

    (I still haven't tested this method, because I found out that my gitlab isn't creating the repos in git user :/ )

    0 讨论(0)
提交回复
热议问题