github中ssh的配置
2018-08-14 本文已影响10人
Alexander
前言
权当笔记, github上配置ssh, 相比较码云配置ssh(之前文章有介绍), 这个小技巧比较简单.
- 打开终端: ssh-keygen -t rsa
~ alexwilliam$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/alexwilliam/.ssh/id_rsa):
/Users/alexwilliam/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/alexwilliam/.ssh/id_rsa.
Your public key has been saved in /Users/alexwilliam/.ssh/id_rsa.pub.(这就是我们需要的公钥)
The key fingerprint is:
SHA256:YKcq81eJfsOIJcqcIaUQ9rxpHbtHBjHq0YisJFCF09Y alexwilliam@zhonglingdeiMac.local
The key's randomart image is:
+---[RSA 2048]----+
| ..+.. |
|o.o ooE |
|+.+o+ = . |
|o+.* = + |
|=o. = =.S. |
|+ .=.+ooo |
| +++.=++ |
| =+..+.+ |
| .... . |
+----[SHA256]-----+
~ alexwilliam$
终端会的这句话: Your public key has been saved in /Users/alexwilliam/.ssh/id_rsa.pub.(这就是我们需要的公钥), 根据路径找到对应的公钥, 并复制.
- 根据路径, 复制公钥, 进入github --- setting --> ssh and GPG keys 把公钥添加进去
- 直接创建仓库即可.
总结
"不积跬步, 无以至千里" , 希望每天都能学点新东西.