【问题标题】:Getting a 403 - permission denied when using aws client to set the acl to public-read获取 403 - 使用 aws 客户端将 acl 设置为公共读取时权限被拒绝
【发布时间】:2018-08-24 18:09:38
【问题描述】:

我正在尝试更改 IBM COS 中的文件 (100KB.file) 的 asl:bucket: 'devtest1.ctl-internal.nasv.cos' 并收到以下消息:

调用 PutObjectAcl 时发生错误 (AccessDenied) 操作:拒绝访问

我的 AWS 凭证(或调用)似乎没有允许 ACL 更新的正确权限。

命令:

aws --endpoint-url=https://s3.us-south.objectstorage.softlayer.net s3api put-object-acl --bucket devtest1.ctl-internal.nasv.cos --key 100KB.file --acl public-read

返回:

调用 PutObjectAcl 时发生错误 (AccessDenied) 操作:拒绝访问

【问题讨论】:

    标签: ibm-cloud ibm-cloud-storage


    【解决方案1】:

    你没有提到你已经在你的存储桶上配置了 hmac 凭证,所以我假设你没有。我还假设 PutObjectAcl 以外的操作不适合您。

    尝试添加 hmac 凭据:

    然后……

    来源:https://console.bluemix.net/docs/services/cloud-object-storage/hmac/credentials.html#using-hmac-credentials

    【讨论】:

      【解决方案2】:

      我在使用 AWS CLI 时也遇到了同样的问题。但是,您可以使用 cURL 并提供您的 IBM Cloud IAM 令牌来执行相同的操作。

      curl -X "PUT" "https://{endpoint}/{bucket-name}/{object-name}?acl" \
       -H "x-amz-acl: public-read" \
       -H "Authorization: Bearer {token}" \
       -H "Content-Type: text/plain; charset=utf-8" \
      

      【讨论】:

        猜你喜欢
        • 2021-08-05
        • 2016-11-11
        • 2017-03-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多