SCP two remote hosts with non-default ports

Iain Morgan imorgan at nas.nasa.gov
Sat May 12 09:02:33 EST 2007


On Fri, May 11, 2007 at 17:03:24 -0400, gerryny at gmail.com wrote:
> Hi,
> 
> I'm having trouble finding the correct syntax to scp between two
> remote hosts with non-defaults ports.
> 
> <scp -P 1234 user at remotehost:/sourcefile -P 4321 user at remotehost:/destfile>
> 
> No matter what i've tried i cant get scp to connect both servers with
> different ports.  Is this even possible?
> 
> The workaround i've found is to use <ssh... "scp...">
> 
> Thanks,
> gerryny at gmail dot com

Have you tried using a Port directive for for the second host
in the ~/.ssh/config on the first host?

-- 
Iain Morgan


More information about the openssh-unix-dev mailing list