Rsync在Amazon EC2实例 [英] Rsync to Amazon Ec2 Instance
本文介绍了Rsync在Amazon EC2实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个EC2实例运行,我可以SSH到它。
I have an EC2 instance running and I am able to SSH into it.
然而,当我尝试rsync的,它给了我否定的错误权限(公钥)。
However, when I try to rsync, it gives me the error Permission denied (publickey).
我使用的命令是:
rsync -avL --progress -e ssh -i ~/mykeypair.pem ~/Sites/my_site/* root@ec2-XX-XXX-XXX-XXX.us-west-2.compute.amazonaws.com:/var/www/html/
我也试过
rsync -avz ~/Sites/mysite/* -e "ssh -i ~/.ssh/id_rsa.pub" root@ec2-XX-XXX-XXX-XXX.us-west-2.compute.amazonaws.com:/var/www/html/
谢谢
推荐答案
我刚刚收到了同样的错误。我一直一直能的SSH:
I just received that same error. I had been consistently able to ssh with:
ssh -i ~/path/mykeypair.pem \
ubuntu@ec2-XX-XXX-XXX-XXX.us-west-2.compute.amazonaws.com
但是,当使用较长的的rsync 建筑,它似乎会导致错误。我结束了包裹在报价的SSH声明和使用的完整路径的关键。在您的例子:
But when using the longer rsync construction, it seemed to cause errors. I ended up encasing the ssh statement in quotations and using the full path to the key. In your example:
rsync -avL --progress -e "ssh -i /path/to/mykeypair.pem" \
~/Sites/my_site/* \
root@ec2-XX-XXX-XXX-XXX.us-west-2.compute.amazonaws.com:/var/www/html/
这似乎这样的伎俩。
这篇关于Rsync在Amazon EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文