How Can I Download a File from EC2 [closed]

Use scp:

scp -i ec2key.pem username@ec2ip:/remote/path/to/file /local/path/to/file

where:

  • ec2key.pem is your PEM key
  • username is the username you log in with into your EC2 instance
  • ec2ip is the IP or DNS alias of your EC2 instance
  • /remote/path/to/file is the location where the file is stored on your EC2 instance
  • /local/path/to/file is where you want to put the file on your local machine

You can use . to put it into the current folder:

scp -i ec2key.pem username@ec2ip:/remote/path/to/file .

You can read more here on how to access your instance with ssh if you haven’t done already:

  • http://docs.aws.amazon.com/gettingstarted/latest/computebasics-linux/getting-started-deploy-app-connect-linux.html

When you are able to ssh as in the above doc, you will be able to use scp to copy the file.

Another option is to bring up some Web server on your instance, configure HTTPS if your file is sensitive and then download using your browser, here are some tutorials:

  • http://flurdy.com/docs/ec2/apache_tomcat/
  • http://www.robotmedia.net/2011/04/how-to-create-an-amazon-ec2-instance-with-apache-php-and-mysql-lamp/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)