第一步 重新生成ssh

输入ssh-keygen -t rsa -C '你的邮箱账户'

后面会有要你输入文件位置和两次密码,不用输入,直接回车回车回车就行。

码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository.  P_用户名


知道出现下面图再输入ssh-agent -s

码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository.  P_保存数据_02

执行成功


码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository.  P_git_03

第二步 把ssh密钥添加到码云

打开C盘–>用户–>用户名–>找到.ssh文件夹。找到id_rsa.pub  如果有多个 找最新生成的那个使用记事本打开进行全选复制

然后打开粘贴到码云的ssh公钥设置里 点击保存数据密码保存成功

码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository.  P_保存数据_04


然后需要执行一下ssh -T git@gitee.com 

码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository.  P_git_05

执行成功

然后进行提交就可以了

码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository.  P_git_06