To use scp to copy files to or from a Google Compute Engine instance:
- Open a terminal window.
- 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]
- 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.