Ssh port forwarding google compute engine

run the command with the debug flag to help you find more information:

gcloud compute ssh --ssh-flag=-vvv "mini-server-1" \
                   --zone="us-central1-f" \
                   --ssh-flag="-D:5551" \
                   --ssh-flag="-N" \
                   --ssh-flag="-n" &

and as mention in my comment before, use https_proxy.


Much simpler syntax:

gcloud compute ssh my-vm-name --zone=europe-west1-b -- -NL 4000:localhost:4000

You can pass as many options as you want:

-NL 8080:localhost:80 -NL 8443:localhost:443
  • https://cloud.google.com/solutions/connecting-securely
  • https://cloud.google.com/community/tutorials/ssh-tunnel-on-gce
  • https://cloud.google.com/community/tutorials/ssh-port-forwarding-set-up-load-testing-on-compute-engine