lost permission on my cloud storage bucket, how to reset them?

浪子不回头ぞ 提交于 2021-01-28 07:37:23

问题


I ran gsutil.py acl set -R public-read gs://dsa-assets and now I see that it override every users permission and I can't upload new file or even delete this bucket. What can I do to reset permission on my bucket or to delete this bucket ?


回答1:


gsutil acl set -R public-read gs://bucketName will set the ACL for bucketName and all of the objects inside of bucketName to the canned ACL public-read. This ACL grants all users read access to the bucket and objects, and it grants FULL_CONTROL to the bucket or object owner.

Every ACL includes FULL_CONTROL for the bucket or object owner. The owner of the bucket will always have FULL_CONTROL of the bucket that they own, no matter how they try.

If you find that you can no longer upload files to the bucket, it is likely that you are not using gsutil with an account that owns the bucket. Figure out which project owns the bucket, and make sure that your account is in the owners group of that project.

Alternately, you could switch which account you're using for gsutil to one that is a project owner temporarily. The easiest way to do this is by using the BOTO_CONFIG environment variable to control multiple profiles:

$> BOTO_CONFIG=/home/me/.boto.owner gsutil config
# Follow prompts to set up account, use an account that owns the bucket
$> BOTO_CONFIG=/home/me/.boto.owner gsutil acl ch -u otherAccount@gmail.com:FC
$> gsutil do stuff with original account


来源:https://stackoverflow.com/questions/20330066/lost-permission-on-my-cloud-storage-bucket-how-to-reset-them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!