gcloud compute tpus tpu-vm scp [[USER@]INSTANCE:]SRC [[[USER@]INSTANCE:]SRC …] [[USER@]INSTANCE:]DEST [--compress] [--dry-run] [--force-key-file-overwrite] [--internal-ip] [--plain] [--recurse] [--scp-flag=SCP_FLAG] [--ssh-key-file=SSH_KEY_FILE] [--strict-host-key-checking=STRICT_HOST_KEY_CHECKING] [--worker=WORKER; default="0"] [--zone=ZONE] [--ssh-key-expiration=SSH_KEY_EXPIRATION | --ssh-key-expire-after=SSH_KEY_EXPIRE_AFTER] [GCLOUD_WIDE_FLAG …]
gcloud compute tpus tpu-vm scp ~/my-file my-tpu:To copy a file into all workers in a Cloud TPU VM, run:
gcloud compute tpus tpu-vm scp ~/my-file my-tpu: --worker=allTo copy a file from a Cloud TPU VM to the home directory of the local computer, run:
gcloud compute tpus tpu-vm scp my-tpu:~/my-file ~/To copy all files in a folder to a Cloud TPU VM, run:
gcloud compute tpus tpu-vm scp ~/my-folder/ my-tpu: --recurseUSER@]INSTANCE:]SRC [[[USER@]INSTANCE:]SRC …]USER@]INSTANCE:]DEST--compress--dry-run--force-key-file-overwrite--internal-ip--plainssh(1)/scp(1)
flags. This flag is useful if you want to take care of authentication yourself
or use specific ssh/scp features.
--recurse--scp-flag=SCP_FLAGscp(1). This flag may be repeated.
--ssh-key-file=SSH_KEY_FILE~/.ssh/google_compute_engine.
--strict-host-key-checking=STRICT_HOST_KEY_CHECKINGSTRICT_HOST_KEY_CHECKING must be one of:
yes, no, ask.
--worker=WORKER; default="0"--command
flag, it additionally supports a comma-separated list (e.g. '1,4,6'), range
(e.g. '1-3'), or special keyword ``all" to run the command concurrently on each
of the specified workers.
Note that when targeting multiple workers, you should run 'ssh-add' with your
private key prior to executing the gcloud command. Default: 'ssh-add
~/.ssh/google_compute_engine'.
--zone=ZONEcompute/zone property isn't set, you might
be prompted to select a zone (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
property:
compute/zone
gcloud config set compute/zone ZONEA list of zones can be fetched by running:
gcloud compute zones listTo unset the property, run:
gcloud config unset compute/zoneCLOUDSDK_COMPUTE_ZONE.
--ssh-key-expiration=SSH_KEY_EXPIRATION--ssh-key-expire-after=SSH_KEY_EXPIRE_AFTER--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 compute tpus tpu-vm scp
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-05-27 UTC.