Have gsutil verify google access key and secret provided to `gsutil config -a`
See original GitHub issueTLDR it’d be nice if gsutil config -a
would verify the google access key and secret before writing them to the .boto file.
gsutil config
gave me the following error message even though I had already authenticated using gcloud auth login
. (somewhat unrelated, perhaps I should open a separate issue?)
CommandException: OAuth2 is the preferred authentication mechanism with the Cloud SDK. Run "gcloud auth login" to configure authentication, unless you want to authenticate with an HMAC access key and secret, in which case run "gsutil config -a".
Anyway, I was able to work around it with gsutil config -a
. I copied and pasted my credentials from the browser and proceeded to configure my .boto file. Then I tried to run some code that made use of gsutil
and got some cryptic error messages about authentication. It took me a while to figure it out, but it turns out I accidentally copied a little more than just the google secret key from the browser so there was some garbage at the end of gs_secret_access_key
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
At last, it works. Thanks to: https://stackoverflow.com/a/38399516/122441 , if someone gets here because same fate as me, here’s how:
gsutil config -a
and input thing you get from step 1. All done! 😃Why these two simple steps are not available in the docs is beyond me …
Thanks for the explanation. Honestly it feels like a crash lesson in cryptography.
IMHO the beginner quickstart should just let the developer use HMAC in 2 simple steps (without even downloading gsutil!), but also put “If you want more advanced authentication mechanism, read on…”