当前位置:   article > 正文

GIT | git添加ssh key_add an ssh key

add an ssh key

场景:

You won't be able to pull or push project code via SSH until you add an SSH key to your profile
在向你的配置文件中添加SSH密匙之前,你将无法通过SSH拉取获取或者推送代码。
  • 1
  • 2

创建一个SSH Key:

lanfeiy@yelanfei MINGW64 /
$ ssh-keygen -t rsa -C "邮件地址"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/lanfeiy/.ssh/id_rsa):
Created directory '/c/Users/lanfeiy/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/lanfeiy/.ssh/id_rsa
Your public key has been saved in /c/Users/lanfeiy/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:IDPd3oMh4UD/PRIEwgH9D2NPXRQ4aBWxZhPadoXL8Gs XXXXXXXXXXXXXXXXXXXXXX
The key's randomart image is:
+---[RSA 3072]----+
|  .==.o..o==oo.  |
|    o* +oo+oo.   |
|    +.*.=.B*..   |
|     +==.X.o+    |
|     . *S =  .   |
|        o. oE    |
|           .     |
|                 |
|                 |
+----[SHA256]-----+

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

在目录C:\Users\lanfeiy.ssh下打开id_rsa.pub文件,将里面的内容添加到GitLab,如下图:

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/207835
推荐阅读
相关标签
  

闽ICP备14008679号