Windows下SSH秘钥生成

先安装git,然后打开git bash,执行口令

git下载链接 https://download.csdn.net/download/best_luxi/12661470

下载完直接安装即可,安装完成之后,右键点开git bash
Windows下SSH秘钥生成
执行口令 ssh-keygen -t rsa -C "你的邮箱",回车。第一个生成文件名字和位置,我习惯性一般不填文件名(填写的话一般在你当前右键的目下生成公钥和私钥),回车。两次输入密码,继续回车,即可生成秘钥。

MINGW64 /f/idea_workspace
$ ssh-keygen -t rsa -C ""
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/lenovo/.ssh/id_rsa):  生成文件名字和位置,一般不填
Created directory ‘/c/Users/lenovo/.ssh‘.  默认生成的公钥和私钥的位置
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:Bu3zVUvcCHwW1qkCtV6QPMdxzcEFybbie06f+lP6nu8 
The key‘s randomart image is:
+---[RSA 2048]----+
|          o++o*O*|
|       . . ++*B=+|
|      . . ..o=*..|
|       o  ..o+.. |
|        S  oo..  |
|       . o ..   .|
|          .  ....|
|            ..ooo|
|             ++BE|
+----[SHA256]-----+
 MINGW64 /f/idea_workspace

找到生成的公钥,用记事本打开即可,将公钥复制gitlab。然后登陆和链接,可以自行百度。