Transfer files

This document explains how to transfer files to and from a virtual machine (VM) instance in Google Distributed Cloud (GDC) air-gapped.

Use secure copy (SCP) from the command line to transfer files to Google Distributed Cloud air-gapped VM instances. Transferring files between VMs in GDC lets you maintain strict data sovereignty and regulatory compliance while still enabling essential operational workflows.

This document is for developers in platform administrator or application operator groups that manage file transfers to and from VMs in a Distributed Cloud environment. For more information, see Audiences for GDC air-gapped documentation.

Before you begin

You need the following to use the SCP command-line tool to transfer files to VMs:
  • You must manually manage your SSH keys.
  • You must enable ingress on port 22 for your VM. See the Enable IP addresses page for more information.

The SCP tool uses the same key files that you use to connect to your instances using standard SSH.

Request IAM roles

Contact your Project IAM Admin to request the following roles on your project:

  • Virtual Machine Project Admin (project-vm-admin): create, modify, list, and delete VMs in the project namespace.

All VM roles must bind to the namespace of the project where the VM resides. Follow the steps to verify your access.

Transfer files to VMs

Locate the external IP address for the VM to which you want to send files using the instructions on the Enable IP addresses page.

Use the SCP tool to copy a file from your workstation to the home directory of the target VM in the following example, which uses a private key at ~/.ssh/my-ssh-key:

scp -i ~/.ssh/my-ssh-key LOCAL_FILE_PATH USERNAME@IP_ADDRESS:~

Use the following definitions for your variables.

VariableDefinition
LOCAL_FILE_PATHThe name of the local file that you want to upload.
USERNAMEYour username.
IP_ADDRESSThe VM's external ingress IP address.

Transfer files from a VM

To copy files from a VM to your local workstation, reverse the source and destination variables. The following example shows how to copy a file from your VM to a path on your workstation:

scp -i ~/.ssh/my-ssh-key USERNAME@IP_ADDRESS:REMOTE_FILE_PATH LOCAL_FILE_PATH

Use the following definitions for your variables.

VariableDefinition
USERNAMEYour username.
IP_ADDRESSThe VM's external ingress IP address.
REMOTE_FILE_PATHThe name of the remote file that you want to download.
LOCAL_FILE_PATHThe location on your workstation to which you want to download the file.