檢查本機(jī)是否有ssh key設(shè)置
$ cd ~/.ssh 或cd .ssh
如果沒有則提示: No such file or directory
如果有則進(jìn)入~/.ssh路徑下(ls查看當(dāng)前路徑文件傀蓉,rm * 刪除所有文件)
1殉挽、使用Git Bash生成新的ssh key郭变。
$ cd ~ #保證當(dāng)前路徑在”~”下
$ ssh-keygen -t rsa -C "xxxxxx@yy.com" #建議填寫自己真實有效的郵箱地址
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xxxx_000/.ssh/id_rsa): #不填直接回車
Enter passphrase (empty for no passphrase): #輸入密碼(可以為空)
Enter same passphrase again: #再次確認(rèn)密碼(可以為空)
Your identification has been saved in /c/Users/xxxx_000/.ssh/id_rsa. #生成的密鑰
Your public key has been saved in /c/Users/xxxx_000/.ssh/id_rsa.pub. #生成的公鑰
The key fingerprint is:
e3:51:33:xx:xx:xx:xx:xxx:61:28:83:e2:81 xxxxxx@yy.com
*本機(jī)已完成ssh key設(shè)置,其存放路徑為:c:/Users/xxxx_000/.ssh/下环壤。
注釋:可生成ssh key自定義名稱的密鑰晒来,默認(rèn)id_rsa。
$ ssh-keygen -t rsa -C "郵箱地址" -f ~/.ssh/githug_blog_keys #生成ssh key的名稱為githug_blog_keys郑现,慎用容易出現(xiàn)其它異常湃崩。