我正在尝试授予其中一名团队成员仅限计算操作系统登录的访问权限,但我无法建立它。
我做得如何?
步骤1
In the appropriate project under the IAM I added the user email and given Role for Compute OS Login after that.
第2步
在终端尝试
# glcoud init
在我提供了所有必要的信息后,我尝试使用 gcloud 登录
# gcloud compute ssh sjkeerthi@test-instance -- -p 2020
No zone specified. Using zone [europe-west2-c] for instance: [test-instance].
Updating project ssh metadata...failed.
Updating instance ssh metadata...failed.
ERROR: (gcloud.compute.ssh) Could not add SSH key to instance metadata:
- The user does not have access to service account '[email protected]'. User: '[email protected]'. Ask a project owner to grant you the iam.serviceAccountActor role on the service account
注意:- 即使我在元数据下设置了 enable-oslogin=True
答案1
我认为以下公开文献在用户账户上配置 OS 登录角色会很有帮助。您收到的错误表明您的用户缺少 (iam.serviceAccountUser) 角色。
The user does not have access to service account '[email protected]'. User: '[email protected]'. Ask a project owner to grant you the iam.serviceAccountActor role on the service account
根据公共文档中提供的示例,您可以通过以下流程向用户授予即时访问权限:
授予用户必要的实例访问角色。
用户必须具有以下角色:
- iam.serviceAccountUser 角色。
以下登录角色之一:
- compute.osLogin 角色不授予管理员权限
- compute.osAdminLogin 角色,授予管理员权限
答案2
答案3
您需要向您的 IAM 账户添加以下角色,如图所示:
- 服务帐户用户,
roles/iam.serviceAccountUser
- 以下任一角色:
- 计算操作系统登录,
roles/compute.osLogin
如果你只想以普通用户身份登录 - 计算操作系统管理员登录,
roles/compute.osAdminLogin
如果你想要能够以管理员身份登录或拥有 root 权限
- 计算操作系统登录,