ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Gitlab使用密钥

2022-07-05 13:01:41  阅读:142  来源: 互联网

标签:git ximalaya Gitlab gitlab 密钥 key 使用 ED25519 com


使用密钥连接gitlab


  1. 首先安装好git,安装地址如下

    https://git-scm.com/download/win

  2. 在桌面,鼠标右键单击,选择Git Bash Here

  3. 生成密钥,如下

    $ ssh-keygen.exe -t ED25519
    Generating public/private ED25519 key pair.
    Enter file in which to save the key (/c/Users/haifeng.gao/.ssh/id_ed25519):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /c/Users/haifeng.gao/.ssh/id_ed25519
    Your public key has been saved in /c/Users/haifeng.gao/.ssh/id_ed25519.pub
    The key fingerprint is:
    SHA256:bR4e/mpXG8qPnFS+mEOye9MuDJi7Jm7Q4C/FnBr+rHs haifeng.gao@XMITDN0504240
    The key's randomart image is:
    +--[ED25519 256]--+
    |                 |
    |                 |
    |                 |
    |    .    .       |
    |   . = .So=   .  |
    |    + * o=oo.oo  |
    |   . *   .+B.+.o |
    |    +.E o o+X=o. |
    |    oO+o.oo=B*+  |
    +----[SHA256]-----+
  4. 将公钥导入到gitlab中的SSH Keys中,如下

  5. 切换至 Git Bash

    $ git clone git@gitlab.ximalaya.com:xmops/salt-nginx-uat.git
    Cloning into 'salt-nginx-uat'...
    The authenticity of host 'gitlab.ximalaya.com (192.168.41.25)' can't be established.
    ED25519 key fingerprint is SHA256:yupomENs/fYD2rX/y01+UHs22f+4jxGNPnNpnE3j9wc.
    This key is not known by any other names
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added 'gitlab.ximalaya.com' (ED25519) to the list of known hosts.
    remote: Enumerating objects: 119, done.
    remote: Counting objects: 100% (119/119), done.
    remote: Compressing objects: 100% (57/57), done.
    remote: Total 26607 (delta 58), reused 89 (delta 42)
    Receiving objects: 100% (26607/26607), 3.54 MiB | 8.58 MiB/s, done.
    Resolving deltas: 100% (15817/15817), done. 

遇到的错误


  • 错误1,在使用rsa类型遇到的,换成

    ED25519 就可以了
    $ git clone git@gitlab.ximalaya.com:xmops/salt-nginx-uat.git
    Cloning into 'salt-nginx-uat'...
    The authenticity of host 'gitlab.ximalaya.com (192.168.41.25)' can't be established.
    ED25519 key fingerprint is SHA256:yupomENs/fYD2rX/y01+UHs22f+4jxGNPnNpnE3j9wc.
    This key is not known by any other names
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added 'gitlab.ximalaya.com' (ED25519) to the list of known hosts.
    git@gitlab.ximalaya.com's password:

标签:git,ximalaya,Gitlab,gitlab,密钥,key,使用,ED25519,com
来源: https://www.cnblogs.com/apink/p/16445993.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有