I frequently use Google Cloud Storage with at least two accounts: [email protected] and [email protected]. I used gsutil config
to create .boto
files for both accounts, which I've renamed to personal.boto
and work.boto
.
It is tiring to have to remember to type cp personal.boto ~/.boto
whenever I need to switch between these accounts. Is there a better way?
The Google Cloud SDK now includes the gcloud
tool, which allows you to login and easily switch between accounts.
$ gcloud auth list
Credentialed accounts:
- [email protected] (active)
To set the active account, run
$ gcloud config set account <account>
To login to another account, simply run $ gcloud auth login
and use another Google account.