Windows
使用ssh-keygen来进行生成
1、启动powershell(这里不能是powershell ise)
2、执行ssh-keygen.exe
3、要求输入文件所在的目录
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\zjxia/.ssh/id_rsa): .ssh/xxxx_id_rsa
这里输入.ssh/xxxx_id_rsa
注意,如果输入的xxxx_id_rsa,则会将文件保存在zjxia下
4、要求输入双因素密码
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\zjxia/.ssh/id_rsa): .ssh/xxxx_id_rsa
Enter passphrase (empty for no passphrase):
5、生成结束,其中 .ssh/xxxx_id_rsa.pub 是公钥
Enter same passphrase again:
Your identification has been saved in .ssh/xxxx_id_rsa.
Your public key has been saved in .ssh/xxxx_id_rsa.pub.
The key fingerprint is:
SHA256:wJkS0KVRqEenmZyaXkc0r5LT05H9GCkiUldD150h5mM zjxia@DESKTOP-VTN3E0G
The key's randomart image is:
+---[RSA 3072]----+
| .oo+oo+ ..o..o |
| ===o o o..o |
| =oO=o o .E |
| o O.o.= +. . |
| = = +So + |
| o = = . . . |
| . . + . |
| . |
| |
+----[SHA256]-----+