This error is because the user that is authenticated for the gsutil command doesn't have the Storage admin Role in order to be able to modify the CORS configuration of the bucket.
As the documentation guides you on installing the full cloud SDK I will asume you have it and can use the commands on it.
- First you need to login for this use the following command:
gcloud auth login
Follow the instructions on screen.
- Once loged in you would need to have Storage admin role in your account, for this you will need to know your Project-id and then grant the permission. So will need to run the following two commands:
gcloud projects list
gcloud projects add-iam-policy-binding <PROJECT-ID> --member='user:<USER_ACCOUNT>' --role='storage.admin'
The project ID you will get it from the first command.
Now you shall be able to run:
set cors.json gs://images/