Sample Header Ad - 728x90

rsync between two PCs which are both reverse SSH into a "jumpbox"?

1 vote
1 answer
64 views
Let us assume we have three computers (they are all running a modern linux distro) call one a jumpbox, and two others PCs: Jumpbox / \ / \ / \ PC1 PC2 **PC1 has a reverse ssh tunnel into jumpbox on port 39999** **PC2 has a reverse ssh tunnel into jumpbox on port 39998** *Jumpbox has no local disk space to spare.* **How do you setup an rsync over ssh to sync files from PC1:/myfiles to PC2:/myfiles?** Note, currently the connections all work, with shared keys: From jumpbox: ssh localhost 39999 will get a login to PC1 ssh localhost 39998 will get a login to PC2 Tried and failed to accomplish this, from PC1, PC2 or even Jumpbox. From jumbox, tried to setup rsync but unsure how to specify ports for each destination. This page offers some insights, but does not seem to work. Also, the scp suggestion at the bottom does not specify ports (which would work, note you can do remote to remote copy, but not sure how to set a -P for each host?) **Update, with temporary solution:** After reading this page , and then this page , the scp + tar solution was tested and found to work from the jumbbox. Using some of tars features, although not as nice as rsync, gets the job done. Just to note, rsync is not intended for rsync remotehost:/files remotehost2:files. I am not a windows user, but if jumpbox were windows based something like WinSCP would work, which I have seen previously. The basic solution can be found in "nortallys" answer on this stack exchange post . Basically: ssh -p 39999 localhost 'tar -cf - /path/to/files/to/copy' |ssh -p 39998 localhost 'tar -xvpf - -C /' This works for now, and switches to tar have been added to mimic rsync.
Asked by number9 (1112 rep)
May 25, 2025, 12:01 PM
Last activity: May 27, 2025, 12:41 PM