How to use the GitBash to clone data with ssh (windows 10 environment)

后端 未结 2 1537
萌比男神i
萌比男神i 2021-01-17 02:47

What can I solve this problem?
when I wanted to connect my personal GitLab account, I got an error message like the following picture

### shell script         


        
2条回答
  •  轮回少年
    2021-01-17 03:00

    Check first if you do have a ~/.ssh/id_rsa private key/~/.ssh/id_rsa.pub public key.

    If so, check your private key: if it has 70 chars per line, try and regenerate with the old PEM format:

    ssh-keygen -m PEM -t rsa -P "" -f ~/.ssh/id_rsa
    

    (That will override your current key, but if said current key is not working anyway, that should be OK).
    Update the public key on GitLab side, and try again, with a simple:

    ssh -T git@gitlab.com
    

    Using a config file means not using the user and using a shorter name:

    Host gitlab
    HostName gitlab.com
    User git
    IdentityFile ~/.ssh/id_rsa 
    

    means: ssh -T gitlab or git clone gitlab:/test2.git will work.

提交回复
热议问题