Skip to main content

SCP

Transfer files using SSH protocol.

Secure copy protocol (SCP) is a command that enables efficient and secure file transfers between two systems over a network. It uses Secure Shell (SSH) to authenticate the systems and encrypt your data.

The basic SCP syntax for transferring a file between two different remote servers is as follows:

scp [options] [source username@IP]:/[directory and file name] [destination username@IP]:/[destination directory]

Here’s the command breakdown:

  • [options] ‒ modifiers to alter the SCP command’s behavior.
  • [source username@IP] ‒ the source system’s username and IP address.
  • :/ – the system address and directory path separator.
  • [directory and file name] ‒ the file’s location and name.
  • [destination username@IP] ‒ the destination system’s user account and IP address.
  • [destination directory] ‒ the transferred files’ target directory.

SCP runs over port 22 by default. Port 22 is open automatically on all Massed Compute VMs out of the box when you rent.

Community recommendations

A few members of our community have shared various techniques to use scp to transfer files into a VM.

Windows

WinSCP - Copy file between a local computer and remote servers or virtual machine.

Mascot