0

I'm trying to disable directory listing by default for my public bucket in Google Cloud. The closest I could find was the third answer to this question:

How to disable google cloud storage bucket list from acl control?

But because I don't have a domain name hooked up to my bucket, I don't have the option to "Edit Website Configuration"

How can I disable directory listing on this public bucket?

Adam McGurk
  • 186
  • 1
  • 19
  • 54
  • You don't need a domain name. The accepted answer is what you want, using a bucket name: https://stackoverflow.com/a/19125329/624900 – jterrace Oct 08 '19 at 15:59
  • @jterrace I'm not looking to delete them from the bucket though, just to remove directory listing. That command looks like it's going to delete them from the bucket, no? – Adam McGurk Oct 08 '19 at 16:03
  • So what you mean is that you have a folder inside of your public bucket and you want to hide just this specific folder from the public but no the whole bucket? Then what you are looking for is to set ACL policies instead of bucket level access. You can see more [information here](https://cloud.google.com/storage/docs/access-control/) – Chris32 Oct 08 '19 at 19:59
  • Yes, the `acl ch` command will remove `AllUsers` from the bucket ACL. That's what you want, because the bucket ACL controls access to bucket metadata and object listing. Reading an individual object is controlled by the object ACL, not the bucket ACL. – jterrace Oct 09 '19 at 21:12

0 Answers0