gsutil Error: serviceexception 401 anonymous caller does not have storage objects list
Issue
I use a web browser to access Google Cloud Storage. But some storages require login to access. When downloading or accessing these storages with gsutil
, there will be an error: ServiceException: 401 Anonymous caller does not have storage.objects.list access to the Google Cloud Storage bucket.
Solution
The gsutil config
command obtains access credentials for Cloud Storage and writes a boto/gsutil configuration file containing the obtained credentials along with a number of other configuration-controllable values. Refer to gsutil config Document.
Run as follows:
Follow the prompt of the command, enter the authorization code and project-id.
After the configuration is complete, you can copy and other operations. For example, to quickly get the total size: