解決:Warning: Permanently added ‘github.com’ (ED25519) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
原因:GitHub SSH秘鑰不對(duì)
0. 檢查本地是否有id_rsa、id_rsa.pub
密匙
- 項(xiàng)目根目錄下,輸入命令
ls ~/.ssh
(大概率沒(méi)有以上兩個(gè)文件,而只出現(xiàn)known hosts
)
1. 生成新秘鑰
-
ssh-keygen -t ed25519 -C "xxx@xxx.com"
(郵箱名稱(chēng)可隨便填寫(xiě)) - 后面一直“回車(chē)”,使用默認(rèn)設(shè)置就行
2. 檢查生成的秘鑰
ls ~/.ssh
3. 打開(kāi)公鑰文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-779750.html
cat ~/.ssh/id_ed25519.pub
4. GitHub上配置SSH keys文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-779750.html
- 個(gè)人設(shè)置settings --> SSH and GPG keys -->new SSH keys
- 復(fù)制粘貼剛剛獲得的公鑰
- 添加
到了這里,關(guān)于Warning: Permanently added ‘github.com’ (ED25519) to the list of known hosts. git@github.com的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!