I need to replace the existing SSH key with a new one, but I don't see such options in Cloud admin panel. What is the right way to do this?


Just replace ~/.ssh/google_compute_engine with the new key and use gcloud compute ssh as you normally would to get access to your VM instances; the key will be automatically propagated to the instances that don't already have it.

If you want to remove the previous key(s), remove them from the metadata for all of the instances where it might have been used; the entry attribute/sshKeys has a list of ssh keys. See the docs for Default metadata for more info.

See the docs for Setting custom metadata for how you can use gcloud to script changes to either project-wide or per-VM-instance metadata.

  • 1
    I can't make a vote up, but anyway thanks for so detailed explanation! Jan 26 '15 at 22:26

You can edit the metadata option to in VM menu options. You can delete, add or remove SSH Keys from there. For step by step process read this article. Add SSH Keys on Google Cloud VM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.