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

Categories

0 votes
266 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...