boto - gsutil 在 GCE 中不工作

标签 boto google-cloud-storage google-compute-engine gsutil

因此,当我使用标准 debian 7 镜像启动 GCE 实例并发出“gsutil config”命令时,它失败并显示以下消息:

jcortez@master:~$ gsutil 配置 失败:没有处理程序准备好进行身份验证。检查了4个处理程序。 ['ComputeAuth', 'OAuth2Auth', 'OAuth2ServiceAccountAuth', 'HmacAuthV1Handler'] 检查您的凭据。

我已经在 debian 6 和 centos 实例上试过了,结果相同。但是,发出“gcutil config”可以正常工作。我想我需要设置我的 ~/.boto 文件,但我不确定要做什么。

我做错了什么?

最佳答案

使用服务帐户范围作为 E. Anderson提及是在 Compute Engine 上使用 gsutil 的推荐方式,因此图像被配置为从/etc/boto.cfg 中的元数据服务器获取 OAuth 访问 token :

[GoogleCompute]
service_account = default

如果您想自己管理 gsutil 配置,重命名/etc/boto.cfg,gsutil config 应该可以工作:

$ sudo mv /etc/boto.cfg /etc/boto.cfg.orig
$ gsutil config
This script will create a boto config file at
/home/<...snipped...>/.boto
containing your credentials, based on your responses to the following questions.
<...snip...>

关于boto - gsutil 在 GCE 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17620517/

相关文章:

python - aws + boto 的 eips 列表

java - 向 Google Cloud Storage API 提供凭据

javascript - 使用 aws js sdk 将大文件(>10GB)直接从浏览器安全地分段上传到 s3,而无需使用 cognito

django - 在将图像添加到存储位置之前,如何在 Django 中优化图像(文件上传)?

c# - 存储客户端列表对象

mysql - 尝试连接到托管在 Google Compute Engine Ubuntu VM 上的 SQL 服务器时如何解决此错误

postgresql - 获取连接到 postgresql Cloud SQL 实例的奇怪的 googleapi 错误 400 消息

python - 无法使用 python 通过 tcp 连接到我的谷歌云虚拟机实例

python - 如何使用 `last_modifed` API 获取 AWS S3 key 的正确 GMT `boto`?

hadoop - 从 Hadoop 访问只读的 Google Storage 存储桶