是否有一种简单的方法可以通过本地机器通过EC2访问S3?

发布于 2025-01-28 22:18:39 字数 196 浏览 2 评论 0原文

我想将文件从S3存储桶传输到本地,但是由于某种原因,我没有灵活性来生成凭据以直接访问。 相反,我可以访问可以访问S3存储桶的EC2实例。 目前,我所做的是

  1. 将文件从S3到EC2
  2. 传输文件从EC2转移到本地,

是否有一种更简单的方法来传输文件?例如,将EC2用作隧道将文件转移到本地,而无需转移到EC2实例。

I want to transfer files from s3 bucket to local, but for some reason I don't have the flexibility to generate credentials for direct access.
Instead I have access to an EC2 instance that has access to the s3 bucket.
Currently what i did is

  1. transfer files from s3 to ec2
  2. transfer files from ec2 to local

Is there an easier way to transfer files in this situation? for example, use the ec2 as an tunnel to direct transfer files to local without transferring to the ec2 instances.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宫墨修音 2025-02-04 22:18:39

我不知道我是否理解……您是否尝试通过本地计算机创建一个访问密钥和配置文件?

1- $ aws IAM create-access-key - 用户名

2- $ aws configure -profile tocopy

3- $ aws s3 cp s3://bucket-name/filename.txt ./-- profile tocopy

ps ps:tocopy ps:是任何命名您的个人资料的字符串。

如果这些步骤不起作用,则需要查看ACL,策略或其他访问存储桶中的访问权限。 ;-)
提示:在您的用户上,将带有GET和列表的策略应用于您的存储桶。

PS:如果您需要多次复制,我应该使用:$ AWS S3 SYN S3://bucket-name/filename.txt ./ - Profile Tocopy

I don’t know if I understood … did you try create an access key and a profile from local machine?

1 - $aws iam create-access-key --user-name

2 - $aws configure --profile tocopy

3 - $aws s3 cp s3://bucket-name/filename.txt ./ —-profile tocopy

Ps: tocopy is any string to named your profile.

If these steps doesn’t work, you need see ACL, Policy or others access control on your bucket. ;-)
Tip: on your user apply an policy with get and list to your bucket.

Ps: if you need copy many times, I should you use: $aws s3 syn s3://bucket-name/filename.txt ./ —-profile tocopy

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文