linux - Rsync to Amazon Ec2 Instance -


i have ec2 instance running , able ssh it.

however, when try rsync, gives me error permission denied (publickey).

the command i'm using is:

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/ 

i tried

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/ 

thanks,

i received same error. had been consistently able ssh with:

ssh -i ~/path/mykeypair.pem \ ubuntu@ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com 

but when using longer rsync construction, seemed cause errors. ended encasing ssh statement in quotations , using full path key. in 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/ 

that seemed trick.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -