easygcloud

Open an IAP TCP tunnel to port 22 on a Compute Engine instance for SSH forwarding

command

gcloud compute start-iap-tunnel INSTANCE_NAME 22 --local-host-port=localhost:2222 --zone=ZONE

also accepted

gcloud compute start-iap-tunnelgcloud compute start-iap-tunnel INSTANCE_NAME

Command breakdown

Part of the Google Cloud CLI (gcloud) — Alpha & Beta category.

gcloudcomputestart-iap-tunnelINSTANCE_NAME22--local-host-port=localhost:2222--zone=ZONE
FlagPurpose
--local-host-portSet to: localhost:2222
--zoneSet to: ZONE

Test your recall — not just your reading.

Practice with interactive quiz →