Git pull and push works in Windows but not in VM

喜夏-厌秋 提交于 2019-12-06 15:35:42

问题


I've recently set up a Git repository and after some fiddling managed to get everything set up correctly so that I could pull and push from Git in my Windows 8.1 environment using SSH keys and pulling from Gitlab ... however in my Ubuntu VM I try to do the same thing (all from command line by the way in both environments if that helps) and it starts asking me for a password which to me would suggest that the VM doesn't know the location of my SSH keys? I could be way off with that thought though.

I can quite happily check git status from the VM. This isn't the end of the world as I can use the Windows environment but I'm still learning all of this and wanted to know why it would be doing that ...

Thank you for any advise on the matter

Regards, Neil


回答1:


First, don't copy your windows keys in your Ubuntu ~/.ssh. The private key is called private for a reason ;)

Second, do check the permission of your new id_rsa and id_rsa.pub files that you need to generate in your new client environment (the Ubuntu one). A ls -alrt ~/.ssh will give you those information.

And if you regenerate new keys in that environment (See GitLab ssh documentation), don't forget to add the public key in your GitLab profile.



来源:https://stackoverflow.com/questions/28793380/git-pull-and-push-works-in-windows-but-not-in-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!