2

I am trying to use project-wide SSH keys on my instances in GCP. However, in the VM instance details, despite unchecking the "Block project-wide SSH keys" checkbox and clicking Save, as advised here, it remains checked and I cannot login to the instances using the SSH keys defined in the project metadata. Has anyone else had this problem and managed to resolve it?

1 Answer 1

2

You can unblock project-wide SSH keys by running this gcloud command from the cloud shell:

gcloud compute instances add-metadata [INSTANCE_NAME] --metadata block-project-ssh-keys=FALSE

After you run the command you can check if the configuration was applied by running:

gcloud compute instances describe [INSTANCE_NAME] --zone [INSTANCE_ZONE]

3
  • Shouldn't it be --metadata block-project-ssh-keys=FALSE ? Aug 19, 2019 at 17:15
  • Yes, you are right, it should be FALSE instead of TRUE Aug 19, 2019 at 18:08
  • Remember to edit the answer. Comments are only temporary, and some people do not see them anyway. I have done it for you this time. Aug 19, 2019 at 18:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .