1. 生成密钥
git config --global user.name "xxx"
git config --global user.email "xxx@qq.com"
ssh-keygen -t rsa -C "xxx@qq.com"
连续按三次回车,这里设置的密码就为空了,并且创建了key。
2.公钥id_rsa.pub填到github.com
3.检查是否成功
ssh git@github.com
出现提示:
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公钥的时候出现:
ssh-keygen unknown key type -rsa
解决方法
- 删除.ssh文件夹
ssh-keygen -C"xxx@qq.com"
注意:-C后面没有空格