Issue
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:
Solution
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
Answered By - John Hanley Answer Checked By - Timothy Miller (WPSolving Admin)