Home Explore Blog CI



man-pages

6th chunk of `rsync.man`
ddd03eb0bb3a6cc43dda884f5c9e1d3b4103eb37d9a76bd10000000100000fdc
 system, so refer to the STARTING AN  RSYNC  DAEMON
       TO ACCEPT CONNECTIONS section below for information on that.)

       Using  rsync in this way is the same as using it with a remote shell ex‐
       cept that:

       o      Use either double‐colon syntax or rsync:// URL syntax instead  of
              the single‐colon (remote shell) syntax.

       o      The first element of the "path" is actually a module name.

       o      Additional  remote source args can use an abbreviated syntax that
              omits the hostname and/or the module name, as  discussed  in  AD‐
              VANCED USAGE.

       o      The  remote daemon may print a "message of the day" when you con‐
              nect.

       o      If you specify only the host (with no module or path) then a list
              of accessible modules on the daemon is output.

       o      If you specify a remote source path but no destination, a listing
              of the matching files on the remote daemon is output.

       o      The --rsh (-e) option must be omitted to avoid changing the  con‐
              nection  style from using a socket connection to USING RSYNC‐DAE‐
              MON FEATURES VIA A REMOTE‐SHELL CONNECTION.

       An example that copies all the files in a remote module named "src":

           rsync ‐av host::src /dest

       Some modules on the remote daemon may require  authentication.   If  so,
       you  will receive a password prompt when you connect.  You can avoid the
       password prompt by setting the environment  variable  RSYNC_PASSWORD  to
       the  password you want to use or using the --password‐file option.  This
       may be useful when scripting rsync.

       WARNING: On some systems environment variables are visible to all users.
       On those systems using --password‐file is recommended.

       You may establish the connection via a web proxy by setting the environ‐
       ment variable RSYNC_PROXY to a hostname:port pair pointing to  your  web
       proxy.  Note that your web proxy’s configuration must support proxy con‐
       nections to port 873.

       You may also establish a daemon connection using a program as a proxy by
       setting  the environment variable RSYNC_CONNECT_PROG to the commands you
       wish to run in place of making a direct socket connection.   The  string
       may  contain  the escape "%H" to represent the hostname specified in the
       rsync command (so use "%%" if you need a single  "%"  in  your  string).
       For example:

           export RSYNC_CONNECT_PROG=’ssh proxyhost nc %H 873’
           rsync ‐av targethost1::module/src/ /dest/
           rsync ‐av rsync://targethost2/module/src/ /dest/

       The  command specified above uses ssh to run nc (netcat) on a proxyhost,
       which forwards all data to port 873 (the rsync daemon) on the targethost
       (%H).

       Note also that if the RSYNC_SHELL environment variable is set, that pro‐
       gram will be used to run the RSYNC_CONNECT_PROG command instead of using
       the default shell of the system() call.

USING RSYNC‐DAEMON FEATURES VIA A REMOTE‐SHELL CONNECTION
       It is sometimes useful to use various features of an rsync daemon  (such
       as  named  modules) without actually allowing any new socket connections
       into a system (other than what is already required to allow remote‐shell
       access).  Rsync supports connecting to a host using a remote  shell  and
       then spawning a single‐use "daemon" server that expects to read its con‐
       fig  file in the home dir of the remote user.  This can be useful if you
       want to encrypt a daemon‐style transfer’s data, but since the daemon  is
       started up fresh by the remote user, you may not be able to use features
       such as chroot or change the uid used by the daemon. (For another way to
       encrypt  a daemon transfer, consider using ssh to tunnel a local port to
       a remote machine and configure a normal

Title: Connecting to an Rsync Daemon and Using Daemon Features via Remote Shell
Summary
This section details connecting to an rsync daemon, specifying that one should use double-colon or `rsync://` URL syntax instead of single-colon (remote shell) syntax, and that the first element of the path is a module name. It outlines how to handle authentication with password prompts, environment variables (RSYNC_PASSWORD or --password-file), and web proxies (RSYNC_PROXY). It also discusses the use of RSYNC_CONNECT_PROG to establish a daemon connection through a proxy. It also explains how to use rsync daemon features via a remote shell connection without allowing new socket connections, by spawning a single-use daemon server.