描述:
更换电脑系统后,重新下载TortoiseGit上传阿里云时出现错误Please make sure you have the correct access rights and the repository exists.
原因:
是云服务器没有发现本地的ssh密钥。(git服务器已经存在我电脑的ssh秘钥)
解决方案:
总思路:重新生成新的 ssh秘钥,再把新的秘钥添加到阿里云服务器的ssh公钥上。
解决问题步骤:
1. 删除 .ssh 文件夹【C:\Users\(本地用户名)\.ssh】 中的 known_hosts(手动删除即可),
2. 在下载好的Git中的bin目录下(一般是 C:\Program Files\Git\bin)打开bash.exe输入命令ssh-keygen -t rsa -C "username" (注:username为你git上的用户名),
3. 出现 Enter file in which to save the key (/Users/username/.ssh/id_rsa): //按回车
4. 返回/Users/your username/.ssh/id_rsa already exists.Overwrite (y/n)? //如果以前有存储地址输入y回车
5. Enter passphrase(empty for no passphrase): //如果以前没有储存地址就会出现这个,直接回车就好
6. 运行完成时 :username/.ssh/id_rsa.pub.(注:username为你git上的用户名)中发现,已经新生成了id_rsa和id_rsa.pub两个文件
7. 打开id_rsa.pub将全部的内容复制到 阿里云的 “个人设置” > “ssh公钥”上
8. 重新上传就可以正常了