如何从EC2下载文件 [英] How Can I Download a File from EC2

查看:149
本文介绍了如何从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如果文件是敏感文件,然后使用浏览器下载,请参考以下教程:




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:

这篇关于如何从EC2下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆