1
votes

I am trying to access GCP cloud shell from my windows localhost by referring to the blog - https://cloud.google.com/blog/products/gcp/introducing-the-ability-to-connect-to-cloud-shell-from-any-terminal

Steps I followed -

1) install gcloud Alpha Commands

2) gcloud alpha cloud-shell ssh

The second step gave the following WARNINGS and then created SSH key pair and pushed it to the cloud shell but I am still not able to connect to cloud shell -

WARNING: The PuTTY PPK SSH key file for gcloud does not exist. WARNING: The public SSH key file for gcloud does not exist. WARNING: The private SSH key file for gcloud does not exist. WARNING: You do not have an SSH key for gcloud. WARNING: SSH keygen will be executed to generate a key. This tool needs to create the directory [C:\Users\myuser.ssh] before being able to generate SSH keys.

Do you want to continue (Y/n)?  Y

API [cloudshell.googleapis.com] not enabled on project [XXXXXXXXX].  Would you like to enable and retry (this will take a few minutes)? (y/N)?  Y

Enabling service [cloudshell.googleapis.com] on project [XXXXXXXXX]... Operation "operations/acf.0987cdf-34gh-7ghj-09op-083532nclafo" finished successfully. 
Pushing your public key to Cloud Shell...

When I try this command - gcloud alpha cloud-shell ssh again. I get below error -

enter image description here

And I don't see my public key added to the Compute Engine -> Metadata section of my GCP console. Can anyone please help me in resolving this?

1
Unrelated comment: Why do you need to connect your environment to Cloud Shell? What's the advantage? What is your use case? (I discover this feature with your question, and I'm surprised!!) - guillaume blaquiere

1 Answers

0
votes

This seems to be a Windows-specific issue. PuTTY can't handle a command line gcloud passes to it.

There is a workaround you can try: https://stackoverflow.com/a/60908389/11602913