Yes, you can do it. Follow the steps below:
-
Use the gsutil acl ch command to grant all users read permission for the object stored in your bucket:
gsutil acl ch -u AllUsers:R gs://my-awesome-bucket/kitten.png
If successful, the command returns:
Updated ACL on gs://my-awesome-bucket/kitten.png
Now anyone can get your object.
-
To remove this permission, use the command:
gsutil acl ch -d AllUsers gs://my-awesome-bucket/kitten.png
If successful, the command returns:
Updated ACL on gs://my-awesome-bucket/kitten.png
You have removed public access to this object.