Google Compute Engine scp Files on a Linux or Unix or Mac OS X

To use scp to copy files to or from a Google Compute Engine instance:

  1. Open a terminal window.
  2. Use the following format to copy a file from your local machine to the instance:
    scp [LOCAL_FILE_PATH] [USERNAME]@[INSTANCE_IP_ADDRESS]:[REMOTE_FILE_PATH]
  3. Use the following format to copy a file from the instance to your local machine:
    scp [USERNAME]@[INSTANCE_IP_ADDRESS]:[REMOTE_FILE_PATH] [LOCAL_FILE_PATH]

Note: Replace [USERNAME] with the username of your account on the instance, [INSTANCE_IP_ADDRESS] with the IP address of the instance, and [LOCAL_FILE_PATH] and [REMOTE_FILE_PATH] with the appropriate file paths.

Leave a Comment