I'm trying to rsync a file over to my EC2 instance:
rsync -Paz --rsh "ssh -i ~/.ssh/myfile.pem" --rsync-path "sudo rsync" file.pdf ubuntu@ec2-XXX-XX-XX-X.compute-1.amazonaws.com:/home/ubuntu/
This gives the following error message:
Warning: Identity file ~/.ssh/myfile.pem not accessible: No such file or directory.
ubuntu@ec2-XXX-XX-XX-X.compute-1.amazonaws.com's password:
The pem file is definitely located at the path ~/.ssh/myfile.pem, though: vi ~/.ssh/myfile.pem shows me the file.
If I remove the remote path from the very end of the rsync command:
rsync -Paz --rsh "ssh -i ~/.ssh/myfile.pem" --rsync-path "sudo rsync" file.pdf ubuntu@ec2-XXX-XX-XX-X.compute-1.amazonaws.com
Then the command appears to work...
building file list ...
1 file to consider
file.pdf
41985 100% 8.79MB/s 0:00:00 (xfer#1, to-check=0/1)
sent 41795 bytes received 42 bytes 83674.00 bytes/sec
total size is 41985 speedup is 1.00
...but when I go to the remote server, nothing has actually been transferred.
What am I doing wrong?
scpinstead, with no problems:scp -i ~/.ssh/myfile.pem file.pdf ubuntu@ec2-XXX-XX-XX-X.compute-1.amazonaws.com:/home/ubuntu/– Richard Nov 19 '12 at 14:54