DEV Community

Cover image for SCP between two hosts with non-standard ports
Adam K Dean
Adam K Dean

Posted on • Edited on

2 3

SCP between two hosts with non-standard ports

Originally posted on January 10th, 2020 (more info)

This applies to the BSD version of SCP, so that means MacOS.

When using SCP to transfer files between two remote hosts which both have non-standard ports, the -p and -P flags will not help you. For this, you need to use the scp protocol format. In addition, you have to pass the -3 arg, which transfers the files indirectly through your local machine, rather than directly between the source and destination machines.

scp -3 \
  scp://<user>@<source_hostname>:<port>/<path> \
  scp://<user>@<dest_hostname>:<port>/<path>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free