2014-11-02 105 views
0

我有我使用主办一对夫妇的git远程仓库的AWS Linux操作系统Ubuntu实例拉动。远程存储库支持git-annex。我能够推/拉/克隆/等。在我的Mac和我的AWS实例之间。试图在Windows计算机上运行的git克隆命令,从AWS远程服务器

我遇到的问题是我的Windows(操作系统:Windows 7)电脑。我下载了msysgit并将其与git-annex一起安装。当我试图运行

git clone [email protected]:/home/ubuntu/git-repo/test.git

(与服务器填入正确的值),我得到了以下错误:

Cloning into 'test' ...

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

顺便说一句,我可以通过下面的命令SSH方式

ssh -i ~/Desktop/gitserverkey.pem [email protected]

当我访问的实例与另一个(和我的MAC)MAC,我可以只用AWS密钥对gitserverkey.pem这样做。是我用我的Mac电脑的步骤如下:

~ cd Desktop/localgitrepo

~ chmod 0400 ~/Downloads/gitserverkey.pem

~ ssh-add ~/Downloads/gitserverkey.pem

~ git clone [email protected]:/home/ubuntu/git-repo/test.git

我这样说是因为一些计算器页面(和谷歌)已经推荐复制我的Windows计算机的私钥到我的AWS实例的known_hosts文件。我不认为这应该是必要的,因为我不必为我的Mac,因为我能够ssh进入。

我的问题是,什么是Windows的等效步骤与我为我的mac执行的那些?如何将我的服务器存储库克隆到本地Windows计算机上?教程或对我的错误的一些洞察将会非常有帮助。

谢谢!

回答

0

什么最终解决我的问题是创建和修改的〜/ .ssh/config并加入如下代码:

⁃ Host amazonaws.com 
⁃ User ubuntu 
⁃ Hostname SERVER.amazonaws 
⁃ PreferredAuthentications public key 
⁃ Port 22 
⁃ IdentityFile ~/Desktop/serverkey.pem 

的ssh的工作,但混帐克隆并没有因为git的克隆没知道在哪里找到必要的钥匙。

0

当您在Mac上运行ssh-add时,您将gitserverkey.pem密钥添加到该计算机的ssh代理,然后该密钥可以将其提供给Git供会话使用。

您需要在Windows机器上执行相同的操作 - 在msysgit外壳中,在尝试克隆之前,运行ssh-add命令将正确的密钥添加到代理。

相关问题