参考:https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
解决步骤
在本地生成ssh key
查看各种文档,发现生成ssh key使用的算法是rsa:
ssh-keygen -t rsa -C "123123@qq.com"
但是这种方式已经不可用了,生成之后加入到github还是报以上的错误!!!
正确的做法:
$ ssh-keygen -t ed25519 -C "your_email@example.com"
生成之后,会在本地生成两个文件:
id_ed25519
id_ed25519.pub
将公钥添加到github
在github主页,用户那里,点击下拉菜单->settings