Just to run the test, I want to put the image file in one of my instance folders from my desktop.
I tried the solutions provided on the same question:
rsync for Amazon Ec2 instance
So I tried:
sudo rsync -azv --progress -e "ssh -i ~/.ssh/MyKeyPair.pem" \ ~/Desktop/luffy.jpg \ec2-user@xx.xx.xx.xxx:/home/ec2-user/myproject/mysite/mysite/media
~ / .ssh / is MyKeyPair.pem. In fact, for input via ssh, I do cd ~ / .ssh first and then run the ssh -i command ....
But I get this error:
Warning: Identity file ~/.ssh/MyKeyPair.pem not accessible: No such file or directory.
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
I read on another Q & A page who got the same error saying that he solved it simply by installing rsync via yum. In my case, it is already installed (version 3.0.6).
I would be grateful if anyone would help!