Linux 生成 SSH密钥

版权声明:本文为博主原创文章,转载请注明出处,谢谢! https://blog.csdn.net/miwumuge/article/details/83244012

当我们想把项目push到GitHub上时,需要为本机添加密钥,下面介绍如何生成SSH密钥

Linux下生成SSH密钥

把邮件地址换成自己的邮件地址,输入命令一路回车就可以了

[fogfore@localhost www]$ ssh-keygen -t rsa -C "你的邮件地址"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/fogfore/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/fogfore/.ssh/id_rsa.
Your public key has been saved in /home/fogfore/.ssh/id_rsa.pub.
The key fingerprint is:
43:ef:9e:42:ea:45:d8:13:dd:41:32:93:8b:e0:50:39 [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
|     ...  +oo    |
|    . E  ..= .   |
|     o oo....    |
|      .+.o.      |
|      . S .      |
|       ..+       |
|       o. .      |
|      .... .     |
|     ..  .o      |
+-----------------+

Window下生成SSH密钥

window下用Git Bash生成密钥,方法参考Linux下生成密钥

添加密钥到GitHub

将.ssh/id_rsa.pub里的内容复制到GitHub

猜你喜欢

转载自blog.csdn.net/miwumuge/article/details/83244012