8

我正在尝试运行 gsutil 命令来列出 Google Cloud Storage 上存储桶中的内容。我几乎可以肯定该命令没有任何问题。

我得到的错误是:

CommandException: You have multiple types of configured credentials (['Oauth 2.0 User Account', 'OAuth 2.0 Service Account']), which is not supported. For more help, see "gsutil help creds".

我已经阅读了“gsutil help creds”中的详细信息,但这仅包含四种凭据类型的高级定义,这没有帮助。

阅读错误消息,似乎我基本上需要删除“配置凭据”之一,在这种情况下,我想删除“Oauth 2.0 用户帐户”凭据。并使用“OAuth 2.0 服务帐户”。

因此,我查看了包含自动生成的配置凭据的“.boto”文件,但看起来没有可以编辑的 Oauth 2.0 用户帐户。

我还尝试在 Google 的开发者控制台中挖掘以删除 Oauth 2.0 用户帐户,但我无法做到。

基本上,我的问题(假设它是正确的问题),如何在 Google Cloud Platform 中删除“Oauth 2.0 用户帐户”凭据?

4

2 回答 2

9

请运行:

gsutil -D

调试输出将包括 config_file_list,它应该向您显示多个凭据的定义位置。

您是从 Google Compute Engine 运行的吗?发生此问题的常见方式是当 GCE 已经创建服务帐户凭据(在 /etc/boto.cfg 中)时,用户在 ~/.boto 中为 gsutil 配置凭据(使用 gsutil config)

于 2014-09-07T22:19:34.383 回答
2

你试过跑步gcloud auth吗?

Usage: gcloud auth [optional flags] <command>
  command may be         activate-refresh-token | activate-service-account |
                         list | login | revoke

Manage oauth2 credentials for the Google Cloud SDK.

optional flags:
  --format FORMAT        Format for printed output.
  --help                 Display detailed help.
  --project PROJECT      Google Cloud Platform project to use for this
                         invocation.
  --quiet, -q            Disable all interactive prompts.
  -h                     Print a summary help and exit.

commands:
  activate-refresh-token
                         Get credentials via an existing refresh token.
  activate-service-account
                         Get credentials via the private key for a service
                         account.
  list                   List the accounts for known credentials.
  login                  Get credentials for the tools in the Google Cloud SDK
                         via a web flow.
  revoke                 Revoke authorization for credentials.
于 2014-09-07T20:46:53.757 回答