gcloud cloud-shell ssh [--authorize-session] [--command=COMMAND] [--dry-run] [--force-key-file-overwrite] [--ssh-flag=SSH_FLAG] [--ssh-key-file] [GCLOUD_WIDE_FLAG …]
gcloud cloud-shell ssh lets you remotely log in to Cloud Shell. If
your Cloud Shell is not currently running, this will cause it to be started
before establishing the SSH session.
gcloud cloud-shell sshTo run a remote command in your Cloud Shell, run:
gcloud cloud-shell ssh --command=ls--authorize-session--command=COMMAND--dry-run--force-key-file-overwrite--ssh-flag=SSH_FLAGssh(1).
--ssh-key-file~/.ssh/google_compute_engine.
--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.
gcloud alpha cloud-shell sshgcloud beta cloud-shell ssh
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-09 UTC.