3

I have a (non-admin) account on one GCP project.

When I start the Dataproc cluster, GCP spins up 3 VMs. When I try to access one of the VM via SSH (in browser) I get the following error:

enter image description here

I tried to add recommended permissions, but I cannot add the iam.serviceAccounts.actAs permission.

enter image description here

Any idea how to solve this? I read through the GCP documentation, but I just cannot find the solution for this. I have the following roles associated with my account:

enter image description here

mLC
  • 543
  • 4
  • 17

3 Answers3

3

In the end, we managed to solve it by granting users the Editor permission on Compute Engine default service account. Not sure it is the right way but it seems to work.

enter image description here

mLC
  • 543
  • 4
  • 17
  • I have the exact same issue, but your solution didn't work for me. Do you find any alternative solution to this? here's my question https://stackoverflow.com/questions/50184382/compute-engine-ssh-you-do-not-have-sufficient-permissions-to-ssh-into-this-inst – Pouya Sanooei May 05 '18 at 00:18
0

I believe the latest documentation on Compute Engine SSH access is here: https://cloud.google.com/compute/docs/instances/managing-instance-access

It seems that you have to enable OS Login on the specific instance(s) you want to SSH into.

Viknesh
  • 495
  • 1
  • 4
  • 14
0

If from console you want to click the "SSH" button next to an instance but face this issue, you can grant the Service Account User role instead of Editor, and it should resolve this.

If you're using OS Login, you may need the Compute OS Login role as well, but SA user should work.

If you're using IAP, you may need the IAP-secured Tunnel User role (or roles/iap.tunnelResourceAccessor in CLI)

Before: recreate issue

After adding Service Account User role: enter image description here

If you want to access remotely, use a bastion and Cloud IAP tunnel. Here is an example setup/teardown (NAT and router optional if you want to configure your bastion or install packages)

Mike S.
  • 4,470
  • 26
  • 34