为什么我的终端返回此s3错误? [英] Why is my terminal returning this s3 error?

查看:669
本文介绍了为什么我的终端返回此s3错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我一直收到的错误:

Here's the error I keep receiving:

A client error (AccessDenied) occurred when calling the ListObjects operation: Access Denied

我已经对我的凭据进行了三重检查,并将这个错误搜索到了我的机智。我编辑了存储桶策略以添加s3:ListBucket操作,但无济于事。这样做时,它只会返回一条类似的消息:

I've triple-checked my credentials and googled this error to my wits' end. I edited my bucket policy to add an s3:ListBucket action, but to no avail. When I do so, it just returns a similar message:

A client error (AccessDenied) occurred when calling the ListBuckets operation: Access Denied

有何想法?这也是我第一次创建s3存储桶,因此很可能我错过了一些重要步骤。

Thoughts? This is also my first time creating an s3 bucket so it's quite possible I missed some important step.

我已经对密钥进行了三遍检查,甚至尝试创建其他用户(编辑存储桶权限以允许经过身份验证的用户)。总是返回相同的错误。

I have triple-checked my keys and even tried creating an additional user (editing the bucket permissions to allow for authenticated users). Always returns the same error.

任何帮助或见解将不胜感激。谢谢!

Any help or insight would be very, very much appreciated. Thank you!

推荐答案

在遇到与您相同的(第二个)错误后,我发现了这个问题:

I found this question after I was getting the same (2nd) error as you:

$ aws s3 ls

A client error (AccessDenied) occurred when calling the ListBuckets operation: Access Denied

原来,这里有一个特定策略权限,您需要添加该权限才能列出所有可用的存储桶:

It turns out that there is a specific policy permission that you need to add to be able to list all the available buckets:

{
    "Sid": "AllowListingOfAllBuckets",
    "Effect": "Allow",
    "Action": [
        "s3:ListAllMyBuckets"
    ],
    "Resource": [
        "arn:aws:s3:::*"
    ]
},

由于您没有说明正在运行哪个命令来产生错误,所以我不能说这是否会对OP很有帮助,但希望它将对在同一地点偶然发现此职位的其他人有所帮助像我一样。

As you don't state which command you were running to generate the error, I can't say whether this will be helpful to the OP, but hopefully it will help someone else who stumbles upon this post in the same situation as me.

这篇关于为什么我的终端返回此s3错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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