Copy files between two remote servers with SFTP

4

3

Which tools able me to copy files between two remote servers with SFTP (SSH File Transfer Protocol)?

I have tried WinSCP, but I am only able to copy files between my local machine and one remote server.

koen

Posted 2010-10-29T17:10:25.933

Reputation: 147

Are the remote machines Windows or Linux? – Brian – 2010-10-29T17:14:28.087

Related: FTP client that supports 2 concurrent FTP sessions.

– Arjan – 2010-10-30T07:00:37.330

Answers

2

To enable file transfer between two remote machines, you'll need to SSH/Telnet/Remote/VNC etc. into one of them and initiate the transfer from there. Any other alternative involving your local machine will necessitate transferring the files to your local first.

Traveling Tech Guy

Posted 2010-10-29T17:10:25.933

Reputation: 8 743

3

Not necessarily true: http://en.wikipedia.org/wiki/File_eXchange_Protocol#FXP_over_SSL

– Arjan – 2010-10-29T17:45:05.520

@Arjan: While Traveling Tech Guy's answer is literally false (you could use some method other than ssh to access one of them and initiate the transfer), the gist is correct: in order to perform a direct copy, you need to execute a command on one of the machines to get it to connect to the other machine. – Gilles 'SO- stop being evil' – 2010-10-30T00:28:26.513

@Arjan, I wouldn't say it's literally false. To pass files between 2 servers without them passing through a third, the transfer process needs to start on one of those servers. Yes, you could use other methodes to remote to that machine (updated my answer - thanks), but the basic facts are the same. – Traveling Tech Guy – 2010-10-30T04:53:14.887

@Gilles and TTG, maybe I am missing the point you're trying to make, but FXP does not require one to use SSH, Telnet, whatever. If the servers support FXP (not very likely) then any FXP-compatible FTP client is all one needs. (Also, the question asker is just looking for a SFTP client that supports connecting to two remote servers. It seems to me he doesn't care if that client uses the local machine as an intermediate storage, he just does not want to manually transfer the files to the local machine first.) – Arjan – 2010-10-30T06:08:27.143

@Arjan that FXP is an interesting thing – barlop – 2011-04-30T09:14:27.167

Indeed, @barlop, but it's often disabled.

– Arjan – 2011-04-30T09:21:25.350

And the question was about SFTP, while FXP is for FTP only – Martin Prikryl – 2013-04-12T12:48:25.010

1

Netcat is another tool that can do this, but netcat would need to be present on both remote servers (not likely if one of them is Windows or Solaris) and you would need to do this via ssh tunnel to be secure, defeating the point since you could just use ssh to accomplish what you want. If security is not an issue, and netcat is available on both machines

adamlogan

Posted 2010-10-29T17:10:25.933

Reputation: 273

0

WinSCP can copy the files between two servers via a local temporary copy. Of course, that would be slow, if your line to the server is slow. It just saves you some manual action.

For more details refer to WinSCP FAQ Can I transfer files between two remote servers with WinSCP?

Martin Prikryl

Posted 2010-10-29T17:10:25.933

Reputation: 13 764