Skip to content

Instantly share code, notes, and snippets.

Avatar

Niccolo Dejito ncdejito

View GitHub Profile
@ncdejito
ncdejito / gcloud-port-forward.md
Last active Apr 21, 2020 — forked from jibs/gcloud-port-forward.md
port forwarding with a google cloud instance
View gcloud-port-forward.md

Google cloud's ssh command lets you pass standard ssh flags. To, for example, forward local port 8088 to port 8088 on a vm instance, all you need to do is:

gcloud compute ssh cholo@deploy-test --ssh-flag="-L 8080:localhost:8080"  --zone "us-central1-a"

Now browsing to localhost:8088 works as it would with standard ssh.

You can’t perform that action at this time.