SCP (Secure CoPy)

SCP uses SSH credentials to copy files and directories between 2 computers. It can be used to copy:

  • From your local computer to a remote computer
  • From a remote computer to your local computer
  • Between two remote computers from your local computer

The colon : sign is used to distinguish remote computer. SCP overwrites files with the same name. Usernames used for SCP must have a read permission on source computer and write permission on target computer.

SCP local -> remote:

scp remote.username@remote.ip.address:/

To copy directory use -r switch:

scp -r remote.username@remote.ip.address:/

If remote computer SSH port is different than default 22:

scp -P port.number remote.username@remote.ip.address:/

SCP remote -> local:

scp remote.username@remote.ip.address:/ /

SCP remote.1 -> remote.2:

scp username1@computer1.ip.address:/ username2@computer2.ip.address:/

The data transfer is direct between remote computers.

Based on:

Leave a Comment

Tested on Ubuntu & Pop OS