gcloud beta cloud-shell ssh

NAME
gcloud beta cloud-shell ssh - allows you to establish an interactive SSH session with Cloud Shell
SYNOPSIS
gcloud beta cloud-shell ssh[--authorize-session][--command=COMMAND][--dry-run][--force-key-file-overwrite][--ssh-flag=SSH_FLAG][--ssh-key-file][GCLOUD_WIDE_FLAG]
DESCRIPTION
(BETA)gcloud beta cloud-shell ssh lets you remotelylog in to Cloud Shell. If your Cloud Shell is not currently running, this willcause it to be started before establishing the SSH session.
EXAMPLES
To SSH into your Cloud Shell, run:
gcloudbetacloud-shellssh

To run a remote command in your Cloud Shell, run:

gcloudbetacloud-shellssh--command=ls
FLAGS
--authorize-session
If provided, sends OAuth credentials to the current Cloud Shell session onbehalf of the user. When this completes, the session will be authorized to runvarious Google Cloud command-line tools without requiring the user to manuallyauthenticate.
--command=COMMAND
A command to run in Cloud Shell.

Runs the command in Cloud Shell and then exits.

--dry-run
If provided, prints the command that would be run to standard out instead ofexecuting it.
--force-key-file-overwrite
If enabled gcloud will regenerate and overwrite the files associated with abroken SSH key without asking for confirmation in both interactive andnon-interactive environment.

If disabled gcloud will not attempt to regenerate the files associated with abroken SSH key and fail in both interactive and non-interactive environment.

--ssh-flag=SSH_FLAG
Additional flags to be passed tossh(1).
--ssh-key-file
The path to the SSH key file. By default, this is~/.ssh/google_compute_engine.
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. Thesevariants are also available:
gcloudcloud-shellssh
gcloudalphacloud-shellssh

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.