【博主已解决】gitee码云push报错:[email protected]: Permission denied (publickey). fatal: Could not read from remote

第一次用gitee和git,一直在报错,改了一整天的错误,终于好了。
到最后一步push的时候报错了,最终用以下方法解决。
【博主已解决】gitee码云push报错:git@gitee.com: Permission denied (publickey). fatal: Could not read from remote_第1张图片

  1. $ ssh-keygen -t rsa -C “[email protected]
    后面改成你的gitee注册或绑定的邮箱。
    会有要你输入文件位置和两次密码,不用输入,直接回车回车回车就行。
    【博主已解决】gitee码云push报错:git@gitee.com: Permission denied (publickey). fatal: Could not read from remote_第2张图片
  2. $ ssh-agent -s
    在这里插入图片描述
  3. 把ssh密钥添加到码云
    打开C盘–>用户–>你的用户名–>找到.ssh文件夹。找到id_rsa.pub(日过有多个用最新的那个),用记事本打开,复制整个文本粘贴到gitee(点头像,进入gitee设置面板,SSH设置,将复制的文本粘贴到公钥,标题会自动生成,然后点击添加,根据提示输入密码就可以了。)

【博主已解决】gitee码云push报错:git@gitee.com: Permission denied (publickey). fatal: Could not read from remote_第3张图片
【博主已解决】gitee码云push报错:git@gitee.com: Permission denied (publickey). fatal: Could not read from remote_第4张图片
【博主已解决】gitee码云push报错:git@gitee.com: Permission denied (publickey). fatal: Could not read from remote_第5张图片
4. $ ssh -T [email protected]
【!!!用码云的姐妹们这里一定是gitee.com不是github.com!!!因为找的教程大多这一句是ssh -T [email protected]就不出现本应该出现的hi,xxx那一句!!!!】
在这里插入图片描述
5. 然后再push就OK啦!解决!
【博主已解决】gitee码云push报错:git@gitee.com: Permission denied (publickey). fatal: Could not read from remote_第6张图片

你可能感兴趣的:(bug区,bug)