HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/help/man/man1/gcloud_app_instances_ssh.1
.TH "GCLOUD_APP_INSTANCES_SSH" 1



.SH "NAME"
.HP
gcloud app instances ssh \- SSH into the VM of an App Engine Flexible instance



.SH "SYNOPSIS"
.HP
\f5gcloud app instances ssh\fR \fIINSTANCE\fR [\fB\-\-container\fR=\fICONTAINER\fR] [\fB\-\-service\fR=\fISERVICE\fR] [\fB\-\-tunnel\-through\-iap\fR] [\fB\-\-version\fR=\fIVERSION\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR] [\-\-\ \fICOMMAND\fR\ ...]



.SH "DESCRIPTION"

\fBgcloud app instances ssh\fR lets you remotely log in to your running App
Engine Flexible instances under two conditions:
.RS 2m
.IP "\(bu" 2m
The instance is running.
.IP "\(bu" 2m
The instance has an external IP address. To check from the Cloud Console, go to
the Instances page and confirm that there is an IP address listed in the VM IP
column. To check from your app.yaml, open your app.yaml and look at the network
settings. The \fBinstance_ip_mode\fR field must be either not listed or set to
\f5\fIexternal\fR\fR.
.RE
.sp

\fBgcloud app instances ssh\fR resolves the instance's IP address and
pre\-populates the VM with a public key managed by gcloud. If the gcloud managed
key pair does not exist, it is generated the first time an SSH command is 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 and
Mac OS X. On Windows, the Google Cloud CLI comes with a bundled PuTTY suite
instead, so it has no external dependencies.



.SH "EXAMPLES"

To SSH into an App Engine Flexible instance, run:

.RS 2m
$ gcloud app instances ssh \-\-service=s1 \-\-version=v1 i1
.RE

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

.RS 2m
$ gcloud app instances ssh \-\-service=s1 \-\-version=v1 i1 \e
  \-\-container=gaeapp
.RE

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

.RS 2m
$ gcloud app instances ssh \-\-service=s1 \-\-version=v1 i1 \e
  \-\-container=gaeapp \-\- echo hello
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
\fIINSTANCE\fR

The instance ID.

.TP 2m
[\-\- \fICOMMAND\fR ...]

Remote command to execute on the VM.

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


.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-container\fR=\fICONTAINER\fR

Name of the container within the VM to connect to.

.TP 2m
\fB\-\-service\fR=\fISERVICE\fR

The service ID.

.TP 2m
\fB\-\-tunnel\-through\-iap\fR

Tunnel the ssh connection through Identity\-Aware Proxy for TCP forwarding.

To learn more, see the IAP for TCP forwarding documentation
(https://cloud.google.com/iap/docs/tcp\-forwarding\-overview).

.TP 2m
\fB\-\-version\fR=\fIVERSION\fR

The version ID.


.RE
.sp

.SH "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 \fB$ gcloud help\fR for details.



.SH "NOTES"

This variant is also available:

.RS 2m
$ gcloud beta app instances ssh
.RE