How to copy entire folder from Amazon EC2 Linux instance to local Linux machine?
scp -i {key path} -r [email protected]:{remote path} {local path}
another way to do it is
scp -i "insert key file here" -r "insert ec2 instance here" "your local directory"
One mistake I made was scp -ir
. The key has to be after the -i
, and the -r
after that.
so
scp -i amazon.pem -r ec2-user@ec2-##-##-##:/source/dir /destination/dir
Call scp
from client machine with recursive option:
scp -r user@remote:src_directory dst_directory