Ssh – Google Console SSH from the Browser will not connect

google-cloud-platformgoogle-compute-enginessh

I have this VM instance in Google Console. The instance was created in project within another organization, then assigned to my email address.

I was assigned all admin related roles in IAM

I tried to access the instance directly via Browser and failed.

I keep getting an error on Console SSH from the Browser

I then tried adding a key and connecting directly. I tried using PuTTy in Windows as well as terminal in Ubuntu.

I have tried adding a key to the project

I have tried adding a key to the instance directly

All I get from the instance is "Too many authentication failures" in Ubuntu and "refused our key" in PuTTy

Server has network setting:
Ingress : Allow SSH from anywhere : Apply to all : IP ranges: 0.0.0.0/0 : tcp:22 : Allow

I am able to access several other instances with no issues, so this issue has left me stumped!

Best Answer

According to your description, it seems your instance is using the os-login feature, since you mention that the instance was created in project within another organization, if that the case you are missing some roles in your user account within the project and role under the organization level as well (not sure if this already applied in the organization level)

1- For your email address, you need to have the iam.serviceAccountUser and one of the following login roles:

  • The compute.osLogin role, which does not grant administrator permissions
  • The compute.osAdminLogin role, which grants administrator permissions

2- On the organization level they need to have compute.osLoginExternalUser role to allow external users outside of your organization access their instances.


In Case you are not using the os-login feature, I suggest you to check the Guest environment if its running correctly.