Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

I try to connect on my VM with my ssh key (legacy project)

When I try to connect on my VM with a SSH key generate with a username that I founded in my console, and fill in GCP metadata. I receive a permission denied. I try to change SSH key my coworker, and her connexion work always. Is there an another place for to change or to add ssh key in GCP ?
However, my coworker added my ip in VPC.

0 1 430
1 REPLY 1

Hello @JCCavalca,

Welcome to Google Cloud Community!

In order to set metadata, you need the ff roles

  • Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1) on the VM or project
  • If your VM uses a service account you need Service Account User (roles/iam.serviceAccountUser) on the service account or project

If you need the exact permissions required, you need:

  • compute.instances.setMetadata - setting metadata on a vm
  • compute.projects.setCommonInstanceMetadata - setting project-wide metadata
  • iam.serviceAccounts.actAs - for VMs that use service accounts