无法将Git推送到AWS EC2

时间:2015-06-20 04:12:08

标签: git amazon-web-services ssh amazon-ec2

我已跟随this blog post在我们的AWS EC2实例上设置远程git仓库。

尽管我遵循博客文章并设置了我的rsa public& amp;我本地计算机上的私钥然后将我的公钥添加到远程aws ec2服务器.ssh / authorised_keys我无法用我的RSA密钥ssh。我收到以下错误(我尝试使用公钥和私钥)。

$ ssh -i ~/.ssh/id_rsa_aws.pub ubuntu@5?.???.???.?4
Agent admitted failure to sign using the key.
Permission denied (publickey).
$ ssh -i ~/.ssh/id_rsa_aws ubuntu@5?.???.???.?4
Agent admitted failure to sign using the key.
Permission denied (publickey).

我继续按照博客文章设置Git,希望我可以克隆,拉动&因为我无法使用AWS PEM密钥进行SSH操作。

我错了,显然git push需要一个RSA密钥。

现在我在尝试git push时遇到此错误:

$ git push origin project-qa 
Agent admitted failure to sign using the key.
Total 0 (delta 0), reused 0 (delta 0)
fatal: Unable to create '/var/git/project.git/refs/heads/project-qa.lock': Permission denied
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

知道我可能做错了吗?我使用以下命令在远程AWS EC2实例上设置permisions:

chmod 640 .ssh/authorized_keys
chmod 750 .ssh

.ssh / authorized_keys文件类似于:

ssh-rsa AAAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????xp qa-180615

ssh-rsa AAAAB????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Gw== creed@creed-VirtualBox

是否与AWS密钥对名称和〜/ .ssh / id_rsa_aws.pub密钥末尾的用户名有关?

0 个答案:

没有答案