GCP虚拟机基于IAM的OS Login登录失败问题求助
基于IAM的虚拟机OS Login登录功能出现故障。
使用gcloud cli执行gcloud compute ssh时,出现以下错误:
ERROR: (gcloud.compute.ssh) User [abc@gmail.com] does not have permission to access users instance [abc@gmail.com] (or it may not exist): End user credentials must match the user specified in the request. Request for user [ abc@gmail.com] does not match the credential for [ABc@gmail.com].
通过浏览器点击VM实例页面的SSH按钮登录时,错误信息如下:
End user credentials must match the user specified in the request. Request for user [ abc@gmail.com] does not match the credential for [ABc@gmail.com].
执行以下操作后,错误仍持续存在:
- 在现有项目中创建新虚拟机
- 在新项目中创建新虚拟机
- 添加小写邮箱的主体,触发了加入自身项目的邮件,但点击后仅进入GC控制台欢迎页面,小写主体未被添加至访问列表
- 失效并重新认证gcloud cli
该项目中的虚拟机已使用OS Login超过一年,此前浏览器SSH及gcloud cli均可正常登录。项目仅有一位用户,基本无人维护,未执行过任何可能修改虚拟机或用户权限的操作,测试用户拥有项目及虚拟机的所有者权限。
移除元数据标签以禁用OS Login并重启虚拟机后,旧SSH方式可正常工作。
上述错误存在两处异常:一是邮箱大小写不一致,二是“Request for user”中的邮箱前存在多余空格,推测问题源于Google端。
现需解决该OS Login登录失败的问题。
内容的提问来源于stack exchange,提问作者stern_terabyte

