简体   繁体   English

在 Google Cloud 虚拟机实例上启用存储权限

[英]Enable storage permission on Google Cloud VM instance

I have a Google Cloud VM instance, but I overlooked setting the Storage permission to read-write when creating it.我有一个 Google Cloud VM 实例,但我忽略了在创建它时将存储权限设置为读写。

Now further down the line, I'm looking to experiment with cloud storage, but my instance is read-only.现在,我想尝试云存储,但我的实例是只读的。

How can this be changed?这怎么能改变呢? I understand it may be possible by relaxing the storage buckets policy, but I'd prefer my instance had write access to all future project buckets.我知道可以通过放宽存储桶策略来实现,但我更希望我的实例具有对所有未来项目存储桶的写访问权限。

I presume there is an option in gcloud to change the devstorage parameter?我认为 gcloud 中有一个选项可以更改 devstorage 参数?

存储已禁用

So, you can't change the option to grant the VM permission, but I did find that you can just run因此,您无法更改授予 VM 权限的选项,但我确实发现您可以运行

gcloud auth login gcloud 身份验证登录

then you can sign in with your management account from the VM and you'll be able to run commands that way.然后您可以从 VM 使用您的管理帐户登录,并且您将能够以这种方式运行命令。

Unfortunately you can't change the scopes of the VM.不幸的是,您无法更改 VM 的范围。 You will have to create a new one to change them.您将不得不创建一个新的来更改它们。

When you create a new one you can reuse the disk of the old VM, if that helps avoid the pain.当你创建一个新的虚拟机时,你可以重用旧虚拟机的磁盘,如果这有助于避免痛苦。

You can update the permissions of your VM instance now but only when it is shut down.您现在可以更新 VM 实例的权限,但只能在其关闭时更新。 Check the following documentation:检查以下文档:

Changing the service account and access scopes for an instance 更改实例的服务帐号和访问范围

If you want to update the API permissions for the kuberntes clusters VM instance then you cannot do that unless you create a new cluster and give the API access to the nodes associated with the clusters.如果您想更新 kuberntes 集群 VM 实例的 API 权限,那么您不能这样做,除非您创建一个新集群并授予 API 访问与集群关联的节点的权限。

I believe they have added the option to change it now, without creating another VM.我相信他们现在已经添加了更改它的选项,而无需创建另一个 VM。 Once you have stopped the instances, click on the instances you want to change.停止实例后,单击要更改的实例。 On the top there is a Edit button, you can click on it and change any the permissions.顶部有一个编辑按钮,您可以单击它并更改任何权限。

Hope the image helps edit button希望图片有助于编辑按钮

Once you have changed the permission to read_write and it still says Access Denied.一旦您更改了 read_write 的权限,它仍然显示拒绝访问。 Go in your instance SSH browser window and enter 'gcloud auth login', follow the steps and hopefully it works!进入您的实例 SSH 浏览器窗口并输入“gcloud auth login”,按照步骤操作,希望它可以正常工作!

You need to stop your vm first, then click on edit and change the cloud api access scopes for storage.您需要先停止虚拟机,然后单击编辑并更改存储的云 API 访问范围。

You may find more information here: https://ismailyenigul.medium.com/setting-access-scope-of-google-cloud-vm-instances-c8637718f453您可以在此处找到更多信息: https : //ismailyenigul.medium.com/setting-access-scope-of-google-cloud-vm-instances-c8637718f453

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Compute Engine VM实例的“ Cloud Datastore”权限 - “Cloud Datastore” permission for Google Compute Engine VM instance Google云端平台,虚拟机实例的ssh权限 - Google cloud platform, vm instance's ssh permission 如何在现有的 Google Cloud VM 实例上启用嵌套虚拟化? - How to enable Nested Virtualization on an existing Google cloud VM instance? 如何将视频从 GCE VM 实例上传到 Google Cloud Storage - How to upload videos to Google Cloud Storage from a GCE VM instance 将文件从VM实例传输到云存储,获得403权限不足的错误消息 - transfer file from VM instance to cloud storage, get error message of 403 insufficient permission Google Cloud VM实例共享 - Google Cloud VM instance Share 谷歌云虚拟机实例没有响应? - Google cloud VM instance not respoding? Google Cloud Storage - 权限不足 - Google Cloud Storage - insufficient permission 如何将 tensorflow 事件从 VM 实例内的 Docker 容器写入谷歌云存储 - How to write tensorflow events to google cloud storage from Docker container inside VM instance 想要在没有互联网的情况下将文件从私有本地实例 (VM) 传输到谷歌云存储 - Want to transfer file from private on-premise Instance (VM) to google cloud storage without internet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM