Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

amazon web services - Why is my terminal returning this s3 error?

Here's the error I keep receiving:

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

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

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:::*"
    ]
},

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...