Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share entire Google Cloud Bucket with GSUTIL

Is there a command using GSUTIL that will allow me to share publicly everything in a specific Bucket? Right now, I'm forced to go through and check "share publicly" individually on EVERY SINGLE FILE in the console.

like image 854
Kirk Sefchik Avatar asked Dec 11 '25 03:12

Kirk Sefchik


1 Answers

The best way to do this is:

gsutil -m acl ch -u 'AllUsers:R' gs://your-bucket/**

will update ACLs for each existing object in the bucket.

If you want newly created objects in this bucket to also be public, you should also run:

gsutil defacl ch -u 'AllUsers:R' gs://your-bucket

This question was also asked here but the answer recommends using acl set public-read which has the downside of potentially altering your existing ACLs.

like image 138
Travis Hobrla Avatar answered Dec 14 '25 08:12

Travis Hobrla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!