Hasam
Hasam

Reputation: 782

Setting up SSH tunnel through GCE

I'm following the instructions here https://cloud.google.com/community/tutorials/ssh-tunnel-on-gce to set up SSH tunnel through Compute Engine. I created a compute instance using this command:

gcloud compute instances create --zone us-west1-a tunnel 

Which is fine, then I tried running the command to start an SSH tunnel on machine on local port 5000 and SSH port 22:

gcloud compute ssh --zone us-west1-a tunnel -- -N -p 22 -D localhost:5000

I get the following error:

enter image description here

Upvotes: 0

Views: 1123

Answers (2)

Mandias
Mandias

Reputation: 876

I had a similar issue with that tutorial, but was able to make it work using this command format instead:

gcloud compute ssh tunnel --zone=us-west1-a -- -NL 5000:localhost:5000

Upvotes: 0

John Hanley
John Hanley

Reputation: 81462

The command you are using does not work on Windows, only Linux. The CLI gcloud launches putty.exe on Windows. Review the putty documentation on the equivalent command-line options and directly launch putty.exe instead of the CLI. For Windows, I recommend using the Windows version of ssh.exe (OpenSSH) instead.

Installation of OpenSSH For Windows Server 2019 and Windows 10

Upvotes: 3

Related Questions