[英]Gcloud : Authenticating with Service Account
Authenticating with service account using gcloud We are using below command for activating service account using .json file. 使用gcloud使用服务帐户进行身份验证我们正在使用以下命令使用.json文件激活服务帐户。
gcloud auth activate-service-account <service_account> --key-file <file_name>
After doing this we are able to deploy templates. 完成此操作后,我们便可以部署模板。 But we are not supposed to keep json file on server for authentication purpose.
但是我们不应该将json文件保留在服务器上以进行身份验证。
Is there any other way of authenticating for deploying templates? 还有其他验证模板的方法吗?
Is there any way to deploy templates using client secret and client id without using json file ? 有什么方法可以使用客户端密钥和客户端ID而不使用json文件来部署模板?
To authorize Cloud SDK tools without storing private key, alternatively use tokens, see OAuth : 要在不存储私钥的情况下授权Cloud SDK工具,或者使用令牌, 请参阅OAuth :
gcloud init
on your local terminal, see Run gcloud init documentation gcloud init
, 请参阅运行gcloud init文档 gcloud init
on Compute Engine VM Instance, see Set up gcloud compute documentation gcloud init
, 请参阅设置gcloud计算文档 To avoid prompts, provide parameters for gcloud init in the command line (works only when $ gcloud config set disable_prompts false
) 为避免出现提示,请在命令行中为gcloud init提供参数(仅在
$ gcloud config set disable_prompts false
)
$ gcloud init --account=[account-name] --configuration=[config-name] --project=[prj-name] --console-only
For more details see documentation Managing SDK Configurations and Managing SDK Properties 有关更多详细信息,请参阅文档“ 管理SDK配置”和“ 管理SDK属性”。
There is also Google Cloud Shell, with 5GB of persistent disk storage and no additional authorization required to use Cloud SDK, see Starting Cloud Shell 还有Google Cloud Shell,具有5GB的永久磁盘存储空间,不需要其他授权即可使用Cloud SDK, 请参阅启动Cloud Shell
To provide authorization you also can use Cloud Identity and Access Management API . 要提供授权,您还可以使用Cloud Identity and Access Management API 。 You may also find helpful the answer for similar question on Stack Overflow
您可能还会发现关于堆栈溢出类似问题的答案很有帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.