0
votes

I'm trying to connect to my google cloud VM from a windows computer.

My normal machine is under linux and everything is ok on this one but right now, i can't use it so i try to connect from this windows' one.

I installed the gcloud sdk and when I try to open a ssh tunnel to connect to the web UI :

gcloud compute ssh my-spark-master --project=my-project --zone=us-east1-b -- -D localhost:10000 -N

i've got a Network error : connection timed out

The user is created on my VM (i have it in the home directory). I have a google_compute_engine.ppk on my local machine, 22 TCP port is open on my project. Ihave authorized "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\sdk\putty.exe" in my windows firewall (but is it well done ?)

 gcloud compute firewall-rules list
NAME                    NETWORK  DIRECTION  PRIORITY  ALLOW                         DENY
default-allow-icmp      default  INGRESS    65534     icmp
default-allow-internal  default  INGRESS    65534     tcp:0-65535,udp:0-65535,icmp
default-allow-rdp       default  INGRESS    65534     tcp:3389
default-allow-ssh       default  INGRESS    65534     tcp:22

To show all fields of the firewall, please show in JSON format: --format=json
To show all fields in table format, please see the examples in --help.

Any hint ?

1

1 Answers

1
votes

Using PuttyGen, create up an SSH key (by randomly moving the mouse pointer and saving the PPK for later use) and add the text prefixed by ssh-rsa * into the Metadata -> SSH Keys in Compute Engine Service.

In PuttyGen, Key-comment mention a Username you want to use for logging in to your VM for e.g. gcp-user

Now when connecting to Google Cloud Compute Engine VM using Putty, just use that gcp-user@<Public-IP-of-VM> and in Key-pair use the above the saved PPK file.

Hope this helps you and let me know if any concern(s).