Mention 3.2.0pre1 release.
[rsync-web.git] / firewall.html
index 7c760d2f1c326f71367ae31635cd42e47f3d427c..86003dad1e00e9295b78859d7e5f7968f111b7ad 100644 (file)
@@ -31,7 +31,7 @@ the target system to succeed (when the username remains the same).
 However, this may not be a desirable setup.
 
 <p>A better method that works with ssh (and is very safe) is to setup an ssh
-key (see the ssh-key manpage) and ensure that ssh-agent forwarding is turned
+key (see the ssh-keygen manpage) and ensure that ssh-agent forwarding is turned
 on in your ssh client config (e.g. "ForwardAgent&nbsp;yes").  You would put
 the public version of your key onto the middle and target systems (in the
 ~/.ssh/authorized_keys file), and the private key on your local system (which
@@ -55,7 +55,7 @@ interaction.
 
 <p>Once that's done, you can do an rsync copy like this:
 
-<blockquote><pre>rsync -av -e "ssh middle ssh" target:/source/ /dest/</pre></blockquote>
+<blockquote><pre>rsync -av -e "ssh middle ssh" target:/src/ /dest/</pre></blockquote>
 
 <h4>Method 2 -- requires ssh and nc (netcat)</h4>
 
@@ -126,7 +126,28 @@ that would use a connection to port 2222 on localhost automatically:
 to connect to the localhost port 2222, not just you, but they'd still need
 to be able to login to the target system using their own credentials.
 
-<h4>Method 4 -- for using rsync in daemon-mode</h4>
+<h4>Method 4 -- for using rsync in daemon-mode (requires nc)</h4>
+
+<p>Install and configure an rsync daemon on the target and use ssh and nc
+to send the socket data to the remote host.
+
+<blockquote><pre>RSYNC_CONNECT_PROG='ssh -l middle_user middle nc %H 873' \
+    rsync daemonuser@target::module/src/ /dest/</pre></blockquote>
+
+<p>(You can also export that variable into your environment if you want to
+perform a series of daemon rsync commands through the same middle host.)
+
+<p>This command takes advantage of the RSYNC_CONNECT_PROG environment
+variable, which tells rsync to pipe its socket data to an external program
+in place of making a direct socket connection.  The command specifed above
+uses ssh to run the nc (netcat) command on the middle host, which forwards
+all socket data to port 873 on the target host (%H).  The "%H" will be
+substituted with the target host from the rsync command as long as you're
+running rsync 3.0.0 or newer (you'll need to replace %H with the actual
+target hostname for earlier rsync versions, which makes the hostname
+specified in the rsync command superfluous).
+
+<h4>Method 5 -- for using rsync in daemon-mode (for those without nc)</h4>
 
 <p>Install and configure an rsync daemon on the target and use an ssh
 tunnel to reach the rsync sever.  This is similar to method 3, but it
@@ -158,8 +179,8 @@ password/passphrase prompts.
 syntax to the local system, the conversation is directed to the target
 system.  For example:
 
-<blockquote><pre>rsync -av --port 8873 localhost::module/source dest/
-rsync -av rsync://localhost:8873/module/source dest/</pre></blockquote>
+<blockquote><pre>rsync -av --port 8873 localhost::module/src/ dest/
+rsync -av rsync://localhost:8873/module/src/ dest/</pre></blockquote>
 
 <p><b>Note:</b> starting an ssh tunnel allows anyone on the source system
 to connect to the localhost port 8873, not just you, so you may want to