如何从EC2下载文件 [英] How Can I Download a File from EC2
问题描述
我应该使用什么 scp
参数将文件从Amazon EC2实例下载到本地存储?
使用scp:
scp -i ec2key.pem username @ ec2ip:/ path /到/文件。
其中:
- ec2key.pem是您的PEM密钥
- 用户名是您登录时使用的用户名
- ec2ip是实例的IP或DNS别名
- / path / to / file是文件存储的位置
这将将文件复制到本地计算机上的当前文件夹中。
如果您还没有这样做,可以在这里阅读更多有关如何使用ssh访问实例的信息:
当您能够像上述文档中那样使用ssh时,将可以使用scp复制文件。 / p>
另一个选择是在您的实例上启动一些Web服务器,配置HTTPS如果文件是敏感文件,然后使用浏览器下载,请参考以下教程:
- 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/
What scp
arguments should I use to download a file from an Amazon EC2 instance to local storage?
Use scp:
scp -i ec2key.pem username@ec2ip:/path/to/file .
where:
- ec2key.pem is your PEM key
- username is the username you log in with
- ec2ip is the IP or DNS alias of the instance
- /path/to/file is the location where the file is stored
This will copy the file into the current folder on the local machine.
You can read more here on how to access your instance with ssh if you haven't done already:
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/
这篇关于如何从EC2下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!