Git生成SSH公钥

# 步骤1
$ ssh-keygen -o  # 一直按enter
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\pr/.ssh/id_rsa):
Created directory 'C:\Users\pr/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\pr/.ssh/id_rsa.
Your public key has been saved in C:\Users\pr/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:dEvpDqEMgGq+iBRmdqUowCRuOrGg7A8kPddHDPp1Jz0 pr@LAPTOP-P6LA87RK
The key's randomart image is:
+---[RSA 2048]----+
|+o.   .          |
|=. . o o   o     |
|=o. =   * * E    |
|O@ o = = * + .   |
|&o= . = S o      |
|++ o   . o       |
|+o.       .      |
|o.o              |
|   .             |
+----[SHA256]-----+

# 步骤2
$ cd ~/.ssh

# 步骤3
$ cat id_rsa.pub

# 步骤4:将pub文件内容添加到对应的GitHub或gitlab账号中去




你可能感兴趣的:(Git生成SSH公钥)