简体   繁体   English

Windows到Ubuntu的git连接

[英]Windows to Ubuntu git connection

I've set up a git server (and gitolite) on an Ubuntu machine at Amazon. 我已经在Amazon的Ubuntu计算机上设置了git服务器(和gitolite)。 I want to interact with this server on Windows. 我想在Windows上与此服务器进行交互。 I've installed Git for Windows (the one that comes with Visual Studio Tools for Git), but trying to access the server ends in the bash prompt telling me "Permission Denied (publickey)." 我已经安装了Windows版Git(Visual Studio Tools for Git附带的一个),但是尝试访问服务器的操作以bash提示符结尾,提示我“权限被拒绝(公钥)”。 I have the ssh keys from the git user on my local machine and Pageant has them loaded, but I don't see any way of telling the git client to use them. 我从本地计算机上的git用户那里获得了ssh密钥,并且Pageant加载了它们,但是我看不出任何告诉git客户端使用它们的方法。 How do I tell the git command line to use my ssh keys? 如何告诉git命令行使用我的ssh键?

Or better yet, does anyone have experience setting up Visual Studio Tools for Git to access their own personal git server rather than one at GitHub? 或者更好的是,没有人有经验来设置Visual Studio Tools for Git来访问自己的个人git服务器,而不是在GitHub上吗?

Ok, so turns out there is a seemingly undocumented step required to set the private keys for Git for Windows. 好的,事实证明,要为Windows的Git设置私钥,似乎需要执行一个未公开的步骤。

When Git for Windows is installed, it creates a new folder, C:\\Users\\[user]\\.ssh . 安装Windows的Git后,它将创建一个新文件夹C:\\Users\\[user]\\.ssh In order to set the keys to use for ssh you must copy for private ssh key for the git user to this directory and it *MUST be named "id_rsa"* . 为了设置用于ssh的密钥,您必须将git用户的ssh私有密钥复制到该目录,并且它必须*被命名为“ id_rsa” * Once you have that key in that folder, you're golden. 在该文件夹中拥有该密钥后,您便会很高兴。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM