因为换了主机,git push的时候,一直让输入密码,密码输入正确也会报permission denied,please try again错误。

原因:你的SSH key不存在或无效了,
检查SSH Key是否存在

$ cd ~/.ssh 
$ ls

解决方法:

  1. 创建SSH Key
$ ssh-keygen -t rsa -C "你的邮箱"
  1. 查看SSH Key
$ cat ~/.ssh/id_rsa.pub
  1. 复制SSH Key添加都你的SSH密钥管理中
    在这里插入图片描述
  2. 重新执行刚才的操作,一切正常~
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐