Amazon s3 – 403禁止使用正确的存储桶策略 [英] Amazon s3 – 403 Forbidden with Correct Bucket Policy

查看:148
本文介绍了Amazon s3 – 403禁止使用正确的存储桶策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用以下存储桶策略公开存储在s3存储桶中的所有图像.

I'm trying to make all of the images I've stored in my s3 bucket publicly readable, using the following bucket policy.

{
"Id": "Policy1380877762691",
"Statement": [
    {
        "Sid": "Stmt1380877761162",
        "Action": [
            "s3:GetObject"
        ],
        "Effect": "Allow",
        "Resource": "arn:aws:s3:::<bucket-name>/*",
        "Principal": {
            "AWS": [
                "*"
            ]
        }
    }
]

}

我还有其他4个具有相同存储桶策略的类似s3存储桶,但我不断收到403错误.

I have 4 other similar s3 buckets with the same bucket policy, but I keep getting 403 errors.

当我尝试将存储桶的内容迁移到新帐户时,已使用s3cmd sync传输了此存储桶中的图像.

The images in this bucket were transferred using s3cmd sync as I'm trying to migrate the contents of the bucket to a new account.

我唯一看到的区别是

  1. 我正在使用具有管理员访问权限的IAM用户,而不是root用户
  2. 文件没有 对授权:每个人都打开/下载文件"权限的每个 文件,文件在旧存储桶中的内容
  1. i'm using an IAM user with admin access, instead of the root user
  2. the files dont have a "grantee : everyone open/download file" permission on each of the files, something the files had in the old bucket

推荐答案

我设法通过再次运行s3cmd命令,但在其末尾添加了--acl-public来解决了该问题.似乎已经解决了我的问题

I've managed to solve it by running the s3cmd command again but adding --acl-public to the end of it. Seems to have fixed my issue

这篇关于Amazon s3 – 403禁止使用正确的存储桶策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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