SCP (Secure Copy Protocol) is a widely used means of sending files from one system to another over a network. SCP uses the SSH server on the target, so there is no need to set up a remote.it Service for SCP if you already have a remote.it Service for SSH installed.
Supposing that you wish to transfer a file "bigfile.bin" in the current folder on your client system to the /home/pi/Downloads folder on the target system, run the following command line. You will need to place the username in the command line as shown.
$ scp -P <port> <path to local file> <target user name>@<hostname>:<full path to target folder>mes out as:
If you are using one of the methods to set up a peer to peer connection, the hostname will be localhost (127.0.0.1) and the port will be as shown by the P2P connection method you are using.
For example, using the Desktop app for Windows:
You can now use this information on the scp command line as shown.
C:\Users\You>scp -P 33000 bigfile.bin pi@localhost:/home/pi/DownloadsThe authenticity of host '[localhost]:33000 ([127.0.0.1]:33000)' can't be established.ECDSA key fingerprint is SHA256:89b83FWn9SdVi9Mp2jwN8lDWu0STbWxfyLrCUgQsj9E.Are you sure you want to continue connecting (yes/no)?Warning: Permanently added '[localhost]:33000' (ECDSA) to the list of known hosts.pi@localhost's password:bigfile.bin 100% 204KB 2.5MB/s 00:00C:\Users\You>
A proxy connection will be returned when you make a connection through the remote.it website, or use the /device/connect API endpoint. You will get a hostname and port that will look something like this:
$ scp -P 34836 bigfile.bin email@example.com:/home/pi/DownloadsThe authenticity of host '[proxy13.remot3.it]:34836 ([220.127.116.11]:34836)' can't be established.ECDSA key fingerprint is SHA256:89b83FWn9SdVi9Mp2jwN8lDWu0STbWxfyLrCUgQsj9E.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '[proxy13.remot3.it]:34836,[18.104.22.168]:34836' (ECDSA) to the list of known hosts.bigfile.bin 100% 498KB 498.5KB/s 00:00$