首页 > 解决方案 > 无法使用 gcloud 为 iam 帐户 GCP 创建密钥文件

问题描述

我正在尝试使用 gcloud 在 GCP 上为服务帐户创建一个密钥文件

gcloud iam service-accounts keys create ~/.config/gcloud/key.json \
--iam-account terraform@$myproject.iam.gserviceaccount.com

不幸的是,它响应

(gcloud) Unable to create private file [~/.config/gcloud/key.json]: [Errno 2] No such file or directory: '~/.config/gcloud/key.json'

文件夹

 '~/.config/gcloud/'

存在。

标签: google-cloud-platformgcloudgoogle-iam

解决方案


问题是:

'~/.config/gcloud/'

这应该是

'/home/mike/.config/gcloud/'

正如约翰汉利正确指出的那样。


推荐阅读