| Server IP : 35.236.43.222 / Your IP : 216.73.216.143 Web Server : Apache System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64 User : deploy ( 1002) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/google-cloud-sdk/lib/surface/compute/__pycache__/ |
Upload File : |
�
��� � �F � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
ddl mZ dd l mZ dd
l
mZ d� Z ej ej j ej j ej j � � ej G d� d
ej � � � � � � Z e� � e_ dS )zFImplements the command for copying files from and to virtual machines.� )�absolute_import)�division)�unicode_literals)�base_classes)�base)�
iap_tunnel)� scp_utils)� ssh_utils)�ipc � � dddd�} | S )z(Generate detailed help for each version.�FCopy files to and from Google Compute Engine virtual machines via scp.a�
*{command}* securely copies files between a virtual machine instance and your
local machine using the scp command.
This command works for Linux VMs and Windows Server 2019 and later VMs that
have [SSH enabled](https://cloud.google.com/compute/docs/connect/windows-ssh).
In order to set up a successful transfer, follow these guidelines:
* Prefix remote file names with the virtual machine instance
name (e.g., _example-instance_:~/_FILE_).
* Local file names can be used as is (e.g., ~/_FILE_).
* File names containing a colon (``:'') must be invoked by either their
absolute path or a path that begins with ``./''.
* When the destination of your transfer is local, all source files must be
from the same virtual machine.
* When the destination of your transfer is remote instead, all sources must
be local.
* When the destination is Windows Server, the source must be using a similar
SSH version.
Under the covers, *scp(1)* is used to facilitate the transfer.
If the `--region` and `--network` flags are provided, then `--plain` and
`--tunnel-through-iap` are implied and any remote file names must be prefixed
with the remote IP address instead of the instance name. This is most useful for
connecting to on-prem resources.a�
To copy a remote directory, `~/narnia`, from ``example-instance'' to the
`~/wardrobe` directory of your local host, run:
$ {command} --recurse example-instance:~/narnia ~/wardrobe
Conversely, files from your local computer can be copied to a virtual machine:
$ {command} ~/localtest.txt ~/localtest2.txt example-instance:~/narnia
Remote Windows-based virtual machines require you to provide a path using
backslash notation:
$ {command} ~/localtest.txt ~/localtest2.txt example-windows-instance:"C:\Users\Public"
Paths for remote Windows-based virtual machines which contain spaces in
directory name should be appropriately protected with a pair of nested single
and double quotes:
$ {command} ~/localtest.txt 'example-windows-instance:"C:\Users\Public\Test Folder"'
If the zone cannot be determined, you will be prompted for it. Use the
`--zone` flag to avoid being prompted:
$ {command} --recurse example-instance:~/narnia ~/wardrobe --zone=us-central1-a
To specify the project, zone, and recurse all together, run:
$ {command} --project="my-gcp-project" --zone="us-east1-b" --recurse ~/foo-folder/ gcp-instance-name:~/
You can limit the allowed time to ssh. For example, to allow a key to be used
through 2019:
$ {command} --recurse example-instance:~/narnia ~/wardrobe --ssh-key-expiration="2020-01-01T00:00:00:00Z"
Or alternatively, allow access for the next two minutes:
$ {command} --recurse example-instance:~/narnia ~/wardrobe --ssh-key-expire-after=2m
To use the IP address of your remote VM (eg, for on-prem), you must also specify
the `--region` and `--network` flags:
$ {command} 10.1.2.3:~/narnia ~/wardrobe --region=us-central1 --network=default
)�brief�DESCRIPTION�EXAMPLES� )�
detailed_helps �lib/surface/compute/scp.py�
_DetailedHelpr s( � �,�$�6+�?K� K�-�Z
�� c �<