Windows下生成ssh key

一、    实现功能

通过git bash生成ssh key,从而可以使用ssh方式登陆gitlab等仓库。很早之前配置,在此重新记录一下,方便自己复用。

二、    步骤

1.    下载并安装git,下载地址
https://git-scm.com/download/win

Windows下生成ssh key_第1张图片
2.    打开gitbash,输入命令

ssh-keygen -t rsa -C “邮箱”

Lenovo@LAPTOP-VG0R2RSI MINGW64 /d/softwares
$ ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Lenovo/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Lenovo/.ssh/id_rsa.
Your public key has been saved in /c/Users/Lenovo/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:et6U/CZJGeP940CuiBcD0pYl2U2Utl87gIfOGAlc0ZY [email protected]
The key's randomart image is:
+---[RSA 2048]----+
|     . +o*oo     |
|      = o E      |
|     . = + +     |
|    . = o * o .  |
|     o .S* B.o . |
|       .+.*+o o  |
|      . .++.o. . |
|       +.+oo..o  |
|      ..o oo.... |
+----[SHA256]-----+

3.    进入C:\Users\Lenovo\.ssh,查看生成公钥和私钥
Windows下生成ssh key_第2张图片


 

你可能感兴趣的:(GitHub操作,GitHub)