gcloud beta app instances ssh

NAME
gcloud beta app instances ssh - SSH into the VM of an App Engine Flexible instance
SYNOPSIS
gcloud beta app instances sshINSTANCE[--container=CONTAINER][--service=SERVICE,-sSERVICE][--tunnel-through-iap][--version=VERSION,-vVERSION][GCLOUD_WIDE_FLAG][--COMMAND …]
DESCRIPTION
(BETA)gcloud beta app instances ssh lets you remotelylog in to your running App Engine Flexible instances under two conditions:
  • The instance is running.
  • The instance has an external IP address. To check from the Cloud Console, go tothe Instances page and confirm that there is an IP address listed in the VM IPcolumn. To check from your app.yaml, open your app.yaml and look at the networksettings. Theinstance_ip_mode field must be either not listed orset toexternal.

gcloud beta app instances ssh resolves the instance's IP addressand pre-populates the VM with a public key managed by gcloud. If the gcloudmanaged key pair does not exist, it is generated the first time an SSH commandis run, which may prompt you for a passphrase for the private key encryption.

All SSH commands require the OpenSSH client suite to be installed on Linux andMac OS X. On Windows, the Google Cloud CLI comes with a bundled PuTTY suiteinstead, so it has no external dependencies.

EXAMPLES
To SSH into an App Engine Flexible instance, run:
gcloudbetaappinstancesssh--service=s1--version=v1i1

To SSH into the app container within an instance, run:

gcloudbetaappinstancesssh--service=s1--version=v1i1--container=gaeapp

To SSH into the app container and run a remote command, run:

gcloudbetaappinstancesssh--service=s1--version=v1i1--container=gaeapp--echohello
POSITIONAL ARGUMENTS
INSTANCE
The instance ID.
[--COMMAND …]
Remote command to execute on the VM.

The '--' argument must be specified between gcloud specific args on the left andCOMMAND on the right.

FLAGS
--container=CONTAINER
Name of the container within the VM to connect to.
--service=SERVICE,-sSERVICE
The service ID.
--tunnel-through-iap
Tunnel the ssh connection through Identity-Aware Proxy for TCP forwarding.

To learn more, see theIAP for TCPforwarding documentation.

--version=VERSION,-vVERSION
The version ID.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
This command is currently in beta and might change without notice. This variantis also available:
gcloudappinstancesssh

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.