GitLab git user password

前端 未结 19 1215
借酒劲吻你
借酒劲吻你 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:33

    Had the same problem in Windows 10 (don't know if this is relevant). Had everything set up correctly, the ssh -vT git@myserver command succeeded, but Gitlab still asked for my password.

    Removing then re-creating the key in Gitlab was the trick for me.

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

    I had the same problem, I spent a lot of time searching!

    I had the idea to use Eclipse to import the project from GitLab.

    Once the project is imported correctly, I made the comparison between the configuration of :

    • the project's Git ripository that I imported into Eclispe, ("in Eclipse", Git Repository, in myprojectRepo / Working Directory / .git / config)
    • the one that is made in .git / config, there i wanted to push my project with git: git push ... and asked me for a password.

    Surprise: The remote does not have the same in both cases. I handed the same as that in eclipse and everything works.

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

    It prompted me for password.

    It shouldn't.
    If you have the right public/private key representing a user authorized to access project-x, then gitlab won't ask you for anything.

    But that supposes that ssh -vT git@192.168.0.108 is working first.

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

    I am using a mac.gitlab is installed in a centos server.

    I have tried all the methods above and found the final answer for me:

    wrong:

    ssh-keygen -t rsa
    

    right:

     ssh-keygen -t rsa -C "your.email@example.com" -b 4096
    
    0 讨论(0)
  • 2020-12-02 22:36

    For my case, it turns out the gitlab was runnign in docker, and has port mapping 4022/22.

    Thus I have to edit ~/.ssh/config to specify the port via Port 4022, e.g:

    Host gitlab-local
        Hostname        192.168.1.101
        User git
        Port 4022
        IdentityFile    ~/.ssh/id_rsa.pub
        # LogLevel DEBUG3
    
    0 讨论(0)
  • 2020-12-02 22:38

    I had this same problem when using a key of 4096 bits:

    $ ssh-keygen -t rsa -C "GitLab" -b 4096
    $ ssh -vT git@gitlabhost
    ...
    debug1: Offering public key: /home/user/.ssh/id_rsa
    debug1: Authentications that can continue: publickey,password
    debug1: Trying private key: /home/user/.ssh/id_dsa
    debug1: Trying private key: /home/user/.ssh/id_ecdsa
    debug1: Next authentication method: password
    git@gitlabhost's password:
    Connection closed by host

    But with the 2048 bit key (the default size), ssh connects to gitlab without prompting for a password (after adding the new pub key to the user's gitlab ssh keys)

    $ ssh-keygen -t rsa -C "GitLab"
    $ ssh -vT git@gitlabhost
    Welcome to GitLab, Joe User!

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