Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Current »

SCP is a method of securely transferring files between a local host and a remote host or between two remote hosts.

  • Example: Copying a file from a local machine to a remote server.

  1. Format: [username@]<computer>:<path>

    • Username: If not specified, your local username is used.

    • Computer: Can be a hostname (e.g., computer.cornell.edu) or an IP address.

    • Colon (:): Indicates a remote location.

    • Path: If not specified, the remote user’s home directory is used.

Examples:

Copying a file to a remote server

scp /path/to/local/file username@remote_host:/path/to/remote/directory/
  • “directory” must exist on the remote computer

  • Paths beginning with “/” are absolute, others are relative to home directory

To recursively copy a directory to a remote computer:

scp –r directory scu-login02.med.cornell.edu:– 
  • The “-r” option specifies the recursive copy

  • If “directory” doesn’t exist on the remote, it will be created

  • If it does exist, just the contents will be copied

  • No labels