-1

I need to copy many files from a remote server (ec2-amazon) to home machine, manually with the WinSCP would take hours. I found this thread using scp to copy a file to amazon EC2 instance but I need to know how to do it the other way around (from the remote server), my basic try just to request your help:

scp ubuntu@ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:/myfiles/ -r /mypc/folder/

Of course I get:

1) Permission denied (publickey).

2) How should I give the destination in my home machine (IP address?).

I'd appreciate your help!

Zia

Community
  • 1
  • 1
miinch
  • 11
  • 1
  • 5

1 Answers1

5

Steps

  1. be in directory where xxx.pem file exists
  2. run this command

scp -i "path to xxx.pem" -r ubuntu@ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:/var/www/html /path to some Downloads/

where /var/www/html is target directory in ec2 instance /path to some Downloads/ local machine download diretory

-r if it's a directory.

Deep 3015
  • 9,929
  • 5
  • 30
  • 54