1 Answers
You could try something like this to remove public access at the bucket level:
gsutil iam ch -d allUsers:objectViewer gs://bucket-name
You can get more examples with:
gsutil help iam
Sign Up Free or Log In to participate!
how do u remove the public access to an object in a bucket from cli
You could try something like this to remove public access at the bucket level:
gsutil iam ch -d allUsers:objectViewer gs://bucket-name
You can get more examples with:
gsutil help iam
Psst…this one if you’ve been moved to ACG!
You can use
gsutil iam get gs://bucket-namee/filename.txt
. That will return a JSON object with the access information for that object. Then you could use that information with agsutil iam set
orgsutil iam ch
to modify it. Example:gsutil iam ch -d allUsers gs://bucket-name/filename.txt
to remove public access for the particular object. (apologies for the formatting)