git push 报错:

Warning: Permanently added ‘github.com,xx.xxx.xxx.xx’ (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

原因:在GitHub中上传代码需要设置公钥,如果设置则可能是当前操作用户与GitHub中存储公钥不匹配。

解决方法

[[email protected] /]$ cd      //进入xxx用户的家目录
[[email protected] ~]$ cd  ~/.ssh/      //进入公私钥存储地方
[[email protected] .ssh]$ ssh-******    //生成公私钥!如果已存在公私钥可以不用生成。

Permanently added 'github.com,xx.xx' (RSA) to the list of known hosts。github配置公钥方法!

[[email protected] .ssh]$ cat id_rsa.pub    //查看公钥内容 

复制公钥 从ssh-rea开始到[email protected]


注意:不需要复制[email protected]


将复制的公钥存储到github上
Permanently added 'github.com,xx.xx' (RSA) to the list of known hosts。github配置公钥方法!
重新push代码即可!

感谢支持!

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2021-07-20
  • 2021-07-02
猜你喜欢
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-11-29
  • 2021-09-12
  • 2021-09-16
相关资源
相似解决方案