Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
248 views
in Technique[技术] by (71.8m points)

ssh - How to copy entire folder from Amazon EC2 Linux instance to local Linux machine?

I connected to Amazon's linux instance from ssh using private key. I am trying to copy entire folder from that instance to my local linux machine .

Can anyone tell me the correct scp command to do this?

Or do I need something more than scp? Both machines are Ubuntu 10.04 LTS

question from:https://stackoverflow.com/questions/9330309/how-to-copy-entire-folder-from-amazon-ec2-linux-instance-to-local-linux-machine

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...