因此,当我使用标准 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/