GitLab git user password

前端 未结 19 1216
借酒劲吻你
借酒劲吻你 2020-12-02 22:10

I have just installed GitLab.

I created a project called project-x.

I have created few users and assigned it to the project.

Now I tried to clone:

相关标签:
19条回答
  • 2020-12-02 22:38

    The same solution for Windows machine:

    1. Generate SSH key and add key to Git lab server
    2. Make sure 2 SSH key files are in /.ssh folder (e.g C:\Users\xxx.ssh)

    Clone should be successful without password require.

    0 讨论(0)
  • 2020-12-02 22:39

    On my Windows 10 machine it was because the SSH_GIT environment variable wasn't set to use the putty plink I had installed on my machine.

    0 讨论(0)
  • 2020-12-02 22:43

    My problem was that I had a DNS entry for gitlab.example.com to point to my load balancer. So when I tried command ssh git@gitlab.example.com I was really connecting to the wrong machine.

    I made an entry in my ~/.ssh/config file:

    Host gitlab.example.com
        Hostname 192.168.1.50
    

    That wasted a lot of time...

    0 讨论(0)
  • 2020-12-02 22:45

    After adding the new SSH Key in GitLab, check if you have "git" group included in SSHD AllowGroups (for Debian /etc/ssh/sshd_config). If not, add it and restart sshd (systemctl restart ssh).

    Test it with ssh -vT git@192.168.8.2 as suggested above.

    0 讨论(0)
  • 2020-12-02 22:46

    Not strictly related to the current scenario. Sometimes when you are prompted for password, it is because you added the wrong* origin format (HTTPS instead of SSH)

    HTTP(S) protocol is commonly used for public repos with strong username+pass
    SSH authentication is more common for internal projects where you can authenticate with a ssh-key-file and simple pass-phrase
    GitLab users are more likely to use the SSH protocol

    View your remote info with

    git remote -v
    

    If you see HTTP(S) address, this is the command to change it to SSH:

    git remote set-url origin git@gitlab.my_domain.com/example-project.git
    
    0 讨论(0)
  • 2020-12-02 22:49

    You may usually if you have multiple keys setup via ssh on your system (my device is running Windows 10), you will encounter this issue, the fix is to:

    Precondition: Setup up your SSH Keys as indicated by GitLab

    1. open /c/Users//.ssh/config file with Notepad++ or your favourite editor
    2. paste the following inside it. Host IdentityFile ~/.ssh/

    Please note, there is a space before the second line, very important to avoid this solution not working.

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