Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Rsync through intermediate server (SSH tunnelling?)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
dudumomo
Posts: 36
Joined: 2012-01-28 09:13

Rsync through intermediate server (SSH tunnelling?)

#1 Post by dudumomo »

Hello,

I need to rsync a project (torproject) on my server (Stockage) but using an intermediary. (another server)

Without the intermediary, I simply need to run:

Code: Select all

rsync -rt --delete rsync.torproject.org::amnesia-archive /media/Stockage/Mirrors/Tails
Now, with the intermediary, I'm facing difficulties.

I have created a ssh key and I can connect now from my Stockage server to the intermediary without issue, but now I want to run the Rsync command and it does not work.
I would like to do it in 1 command line, to use only when needed.

I've tried this:

Code: Select all

rsync -rt --delete --progress -e "ssh user@intermediate.server ssh" rsync.torproject.org::amnesia-archive /media/Stockage/Mirrors/Tails
But I got:

Code: Select all

ssh: connect to host rsync.torproject.org port 22: Connection refused
rsync: did not see server greeting
rsync error: error starting client-server protocol (code 5) at main.c(1666) [Receiver=3.1.2]
Obviously the syntax looks incorrect.

Any idea what it should be?

Thank you
Freedif, my blog with plently of tutorials to install opensource apps
Idipops, my newly created social network for pro (In Ruby and AngularjS)

reinob
Posts: 1195
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Rsync through intermediate server (SSH tunnelling?)

#2 Post by reinob »

rsync can use *either* the rsync protocol or ssh.

You want to connect to a rsync server (rsync.torproject.org::amnesia-archive), so you can't use ssh for it.
If the torproject server allows rsync via ssh, then what you want will work. But it doesn't, as you can see ("connection refused").

If not, you have no solution to your problem. Unless of course you rsync from your intermediate server (if you control it and have space for it) and then rsync from your initial server to the intermediate one.

dudumomo
Posts: 36
Joined: 2012-01-28 09:13

Re: Rsync through intermediate server (SSH tunnelling?)

#3 Post by dudumomo »

A friend helped me with this.

Here is the command needed

Code: Select all

RSYNC_CONNECT_PROG='ssh -l user intermediateserver nc %H 873' rsync -rt --delete --progress rsync.torproject.org::amnesia-archive /media/Stockage/Mirrors/Tails
You will need netcat.

Works well now, and in 1 line.

I wasn't aware of such environment.

Hope it can helps others
Freedif, my blog with plently of tutorials to install opensource apps
Idipops, my newly created social network for pro (In Ruby and AngularjS)

reinob
Posts: 1195
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Rsync through intermediate server (SSH tunnelling?)

#4 Post by reinob »

That's a cool solution!

(and it's actually described in the manual :)

reinob
Posts: 1195
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Rsync through intermediate server (SSH tunnelling?)

#5 Post by reinob »

reinob wrote:That's a cool solution!

(and it's actually described in the manual :)
NOTE however that the rsync protocol does not do any encryption on its own. So your connection between the intermediate (proxy) server and the destination (rsync daemon) -- which is what netcat is doing -- will be clear-text.

Post Reply