1. 生成密鑰
git config --global user.name "xxx"
git config --global user.email "xxx@qq.com"
ssh-keygen -t rsa -C "xxx@qq.com"
連續(xù)按三次回車,這里設(shè)置的密碼就為空了,并且創(chuàng)建了key。
2.公鑰id_rsa.pub填到github.com
3.檢查是否成功
ssh git@github.com
出現(xiàn)提示:
PTY allocation request failed on channel 0
Hi peipei1024! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
今天配置 git公鑰的時(shí)候出現(xiàn):
ssh-keygen unknown key type -rsa
解決方法
- 刪除.ssh文件夾
ssh-keygen -C"xxx@qq.com"
注意:-C后面沒有空格