Find S3 Bucket Owner

22,882

Use get-bucket-acl, if you have read permission of the bucket. It would give output like this

{
    "Owner": {
        "DisplayName": "my-username",
        "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32"
    },
    "Grants": [
        {
            "Grantee": {
                "DisplayName": "my-username",
                "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32"
            },
            "Permission": "FULL_CONTROL"
        }
    ]
}
Share:
22,882
Felix Geisendörfer
Author by

Felix Geisendörfer

Updated on July 09, 2022

Comments

  • Felix Geisendörfer
    Felix Geisendörfer almost 2 years

    If there is a bucket that I have read/write access on from my AWS account, is there any way to get the CanonicalUser id of the owner?

    Reading the ACL Policy seems to be impossible unless you are the owner : /.

  • homm
    homm almost 10 years
    object owner is not bucket owner
  • Viccari
    Viccari almost 10 years
    @homm Yeah, but from the question I understood the OP wanted to know the bucket owner...
  • homm
    homm almost 10 years
    Seem like a error in documentation. ListBucketResult.Contents is objects in bucket, so ListBucketResult.Contents.Owner is object's owner.