VM实例服务帐户可以识别
尽管我扮演了该特定服务的所有者角色,但我无法从本地与SSH联系的实例中使用权限。
也无法将我的文件上传到我在云平台中创建的存储存储桶。
这是问题的屏幕截图:
i.sstatic.net/jbazo.png“ alt =“ cloud Iam page”>
Although I've gave Owner role to that specific service, I can't use the permissions from my instances that I connect with SSH from my local.
Also can't upload my files to Storage bucket which I've created in cloud platform.
Here is the screenshots of the problem:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该问题可能是由于访问令牌不具有执行所需活动的适当权限范围而引起的。为了确保您正确使用此服务帐户的身份验证范围,我建议执行以下操作:
为服务帐户创建一个新密钥。这将创建一个 .json
当前目录中包含私有文件
服务帐户的身份验证密钥。
服务帐户。
$gcloud auth list
检查这是否有效。在输出中,您应该在服务之前看到一个星号
帐户名称,表明这是您所在的服务帐户
目前正在使用。
$env:GOOGLE_APPLICATION_CREDENTIALS =“KEY_PATH”
The problem might be caused by the access token not having the appropriate permission scopes to conduct the required activity. To make sure you're using the auth scope of this service account appropriately, I recommend doing the following:
create a new key for the service account. This will create a .json
file inside the current directory containing the private
authentication key for the service account.
service account.
$gcloud auth list
to check if this worked.In the output you should see an asterisk before the service
account’s name, indicating that this is the service account you are
currently using.
$env:GOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"
Google 云计算虚拟机具有访问范围设置。此功能可以限制服务帐户附加到虚拟机时拥有的权限。
转到 Google Cloud Console GUI,选择您的虚拟机,停止虚拟机,然后编辑访问范围以授予您所需的权限。
访问范围
Google Cloud Compute VMs have a setting for Access Scopes. This feature can limit the permissions that a service account has when attached to a virtual machine.
Go to the Google Cloud Console GUI, select your VM, stop the VM and then edit Acess Scopes to grant the permissions you require.
Access scopes