Here's an example of a little larger scope. A->B->C is very easy:

A -> B -> C -> D -> E
|                   ^
\-------------------/

A> ssh -l UserOnB -L 6400:C:22 B # Create Tunnel from A->C though B on 6400
A> ssh -l UserOnC -p 6400 -L 6500:D:22 A # Create Tunnel from A -> D on 6500
A> ssh -l UserOnD -p 6500 -L 6600:E:22 A # Create Tunnel from A -> E on 6600
A> ssh -l UserOnE -p 6600 A # Puts me on E

To just tunnel from A->C through B use the first command. Then:
A> rsync -e ssh --port=6400 -whateveroptions /sourcefile userone@localhost
will connect you to C from A. Remember UserOnB will have to have UserOnA's
public key and the same goes for UserOnC for UserOnB's key.

Hope this helps!

---
Matthew R. Demicco
Taos Unix SysAdmin

> Heya,
> 
>     Our network is set up as follows:
> 
> A -> B -> C
> 
> I have a need to keep filesystems on A and C in sync. There's 
> a firewall
> between A and B, and another one between B and C. There is no 
> SOCKS and
> all connections must be initiated in the direction of the 
> arrows shown, in
> keeping with corporate security policies.
> 
> I can probably get my firewall admins to open up port 22 for 
> ssh, after a 
> lot of wrangling, and most likely, no other ports. How do I
> recursively tunnel from A to B and then B to C for rsync? 
> Using B as an
> intermediate storage area is not an option.
> 
> In other words, I'd like to rsync over two consecutive ssh 
> tunnels (X11
> forwarding works without any problems over 2 tunnels). How can I
> accomplish this? Thanks!
> 
> - Mandar
> 

Reply via email to