質問

I frequently use Google Cloud Storage with at least two accounts: personal@gmail.com and work@corp.com. 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?

役に立ちましたか?

解決 2

Easiest way to do this is as follows:

$ BOTO_CONFIG=/path/to/personal.boto gsutil cp #...

For more detailed variations on this theme see this thread.

他のヒント

The Google Cloud SDK now includes the gcloud tool, which allows you to login and easily switch between accounts.

$ gcloud auth list
Credentialed accounts:
 - youremail@gmail.com (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.

For this, use following command to switch to the account you want.

gcloud auth login

This will take you to the Google account switch page which can be used to switch to the relevant user.

under windows OS: set BOTO_CONFIG=E:\.boto & e:\gsutil\gsutil.py ls s3://your_bucket/folder

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top