前言
權當筆記, 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.(這就是我們需要的公鑰), 根據(jù)路徑找到對應的公鑰, 并復制.
- 根據(jù)路徑, 復制公鑰, 進入github --- setting --> ssh and GPG keys 把公鑰添加進去
- 直接創(chuàng)建倉庫即可.
總結
"不積跬步, 無以至千里" , 希望每天都能學點新東西.