Bump to 3.2.7
[platform/upstream/rsync.git] / rsyncd.conf.5
1 .TH "rsyncd.conf" "5" "20 Oct 2022" "rsyncd.conf from rsync 3.2.7" "User Commands"
2 .\" prefix=/usr
3 .P
4 .SH "NAME"
5 .P
6 rsyncd.conf \- configuration file for rsync in daemon mode
7 .P
8 .SH "SYNOPSIS"
9 .P
10 rsyncd.conf
11 .P
12 The online version of this manpage (that includes cross-linking of topics)
13 is available at https://download.samba.org/pub/rsync/rsyncd.conf.5.
14 .P
15 .SH "DESCRIPTION"
16 .P
17 The rsyncd.conf file is the runtime configuration file for rsync when run as an
18 rsync daemon.
19 .P
20 The rsyncd.conf file controls authentication, access, logging and available
21 modules.
22 .P
23 .SH "FILE FORMAT"
24 .P
25 The file consists of modules and parameters. A module begins with the name of
26 the module in square brackets and continues until the next module begins.
27 Modules contain parameters of the form \fBname\ =\ value\fP.
28 .P
29 The file is line-based\ \-\- that is, each newline-terminated line represents
30 either a comment, a module name or a parameter.
31 .P
32 Only the first equals sign in a parameter is significant. Whitespace before or
33 after the first equals sign is discarded. Leading, trailing and internal
34 whitespace in module and parameter names is irrelevant. Leading and trailing
35 whitespace in a parameter value is discarded. Internal whitespace within a
36 parameter value is retained verbatim.
37 .P
38 Any line \fBbeginning\fP with a hash (\fB#\fP) is ignored, as are lines containing
39 only whitespace. (If a hash occurs after anything other than leading
40 whitespace, it is considered a part of the line's content.)
41 .P
42 Any line ending in a \fB\\\fP is "continued" on the next line in the customary UNIX
43 fashion.
44 .P
45 The values following the equals sign in parameters are all either a string (no
46 quotes needed) or a boolean, which may be given as yes/no, 0/1 or true/false.
47 Case is not significant in boolean values, but is preserved in string values.
48 .P
49 .SH "LAUNCHING THE RSYNC DAEMON"
50 .P
51 The rsync daemon is launched by specifying the \fB\-\-daemon\fP option to rsync.
52 .P
53 The daemon must run with root privileges if you wish to use chroot, to bind to
54 a port numbered under 1024 (as is the default 873), or to set file ownership.
55 Otherwise, it must just have permission to read and write the appropriate data,
56 log, and lock files.
57 .P
58 You can launch it either via inetd, as a stand-alone daemon, or from an rsync
59 client via a remote shell.  If run as a stand-alone daemon then just run the
60 command "\fBrsync\ \-\-daemon\fP" from a suitable startup script.
61 .P
62 When run via inetd you should add a line like this to /etc/services:
63 .RS 4
64 .P
65 .nf
66 rsync           873/tcp
67 .fi
68 .RE
69 .P
70 and a single line something like this to /etc/inetd.conf:
71 .RS 4
72 .P
73 .nf
74 rsync   stream  tcp     nowait  root   /usr/bin/rsync rsyncd --daemon
75 .fi
76 .RE
77 .P
78 Replace "/usr/bin/rsync" with the path to where you have rsync installed on
79 your system.  You will then need to send inetd a HUP signal to tell it to
80 reread its config file.
81 .P
82 Note that you should \fBnot\fP send the rsync daemon a HUP signal to force it to
83 reread the \fBrsyncd.conf\fP file. The file is re-read on each client connection.
84 .P
85 .SH "GLOBAL PARAMETERS"
86 .P
87 The first parameters in the file (before a [module] header) are the global
88 parameters.  Rsync also allows for the use of a "[global]" module name to
89 indicate the start of one or more global-parameter sections (the name must be
90 lower case).
91 .P
92 You may also include any module parameters in the global part of the config
93 file in which case the supplied value will override the default for that
94 parameter.
95 .P
96 You may use references to environment variables in the values of parameters.
97 String parameters will have %VAR% references expanded as late as possible (when
98 the string is first used in the program), allowing for the use of variables
99 that rsync sets at connection time, such as RSYNC_USER_NAME.  Non-string
100 parameters (such as true/false settings) are expanded when read from the config
101 file.  If a variable does not exist in the environment, or if a sequence of
102 characters is not a valid reference (such as an un-paired percent sign), the
103 raw characters are passed through unchanged.  This helps with backward
104 compatibility and safety (e.g. expanding a non-existent %VAR% to an empty
105 string in a path could result in a very unsafe path).  The safest way to insert
106 a literal % into a value is to use %%.
107 .P
108 .IP "\fBmotd\ file\fP"
109 This parameter allows you to specify a "message of the day" (MOTD) to display
110 to clients on each connect. This usually contains site information and any
111 legal notices. The default is no MOTD file.  This can be overridden by the
112 \fB\-\-dparam=motdfile=FILE\fP command-line option when starting the daemon.
113 .IP "\fBpid\ file\fP"
114 This parameter tells the rsync daemon to write its process ID to that file.
115 The rsync keeps the file locked so that it can know when it is safe to
116 overwrite an existing file.
117 .IP
118 The filename can be overridden by the \fB\-\-dparam=pidfile=FILE\fP command-line
119 option when starting the daemon.
120 .IP "\fBport\fP"
121 You can override the default port the daemon will listen on by specifying
122 this value (defaults to 873).  This is ignored if the daemon is being run
123 by inetd, and is superseded by the \fB\-\-port\fP command-line option.
124 .IP "\fBaddress\fP"
125 You can override the default IP address the daemon will listen on by
126 specifying this value.  This is ignored if the daemon is being run by
127 inetd, and is superseded by the \fB\-\-address\fP command-line option.
128 .IP "\fBsocket\ options\fP"
129 This parameter can provide endless fun for people who like to tune their
130 systems to the utmost degree. You can set all sorts of socket options which
131 may make transfers faster (or slower!). Read the manpage for the
132 \fBsetsockopt()\fP system call for details on some of the options you may be
133 able to set. By default no special socket options are set.  These settings
134 can also be specified via the \fB\-\-sockopts\fP command-line option.
135 .IP "\fBlisten\ backlog\fP"
136 You can override the default backlog value when the daemon listens for
137 connections.  It defaults to 5.
138 .P
139 .SH "MODULE PARAMETERS"
140 .P
141 After the global parameters you should define a number of modules, each module
142 exports a directory tree as a symbolic name. Modules are exported by specifying
143 a module name in square brackets [module] followed by the parameters for that
144 module.  The module name cannot contain a slash or a closing square bracket.
145 If the name contains whitespace, each internal sequence of whitespace will be
146 changed into a single space, while leading or trailing whitespace will be
147 discarded.  Also, the name cannot be "global" as that exact name indicates that
148 global parameters follow (see above).
149 .P
150 As with GLOBAL PARAMETERS, you may use references to environment variables in
151 the values of parameters.  See the GLOBAL PARAMETERS section for more details.
152 .P
153 .IP "\fBcomment\fP"
154 This parameter specifies a description string that is displayed next to the
155 module name when clients obtain a list of available modules. The default is
156 no comment.
157 .IP "\fBpath\fP"
158 This parameter specifies the directory in the daemon's filesystem to make
159 available in this module.  You must specify this parameter for each module
160 in \fBrsyncd.conf\fP.
161 .IP
162 If the value contains a "/./" element then the path will be divided at that
163 point into a chroot dir and an inner-chroot subdir.  If \fBuse\ chroot\fP
164 is set to false, though, the extraneous dot dir is just cleaned out of the
165 path.  An example of this idiom is:
166 .RS 4
167 .IP
168 .nf
169 path = /var/rsync/./module1
170 .fi
171 .RE
172 .IP
173 This will (when chrooting) chroot to "/var/rsync" and set the inside-chroot
174 path to "/module1".
175 .IP
176 You may base the path's value off of an environment variable by surrounding
177 the variable name with percent signs.  You can even reference a variable
178 that is set by rsync when the user connects.  For example, this would use
179 the authorizing user's name in the path:
180 .RS 4
181 .IP
182 .nf
183 path = /home/%RSYNC_USER_NAME%
184 .fi
185 .RE
186 .IP
187 It is fine if the path includes internal spaces\ \-\- they will be retained
188 verbatim (which means that you shouldn't try to escape them).  If your
189 final directory has a trailing space (and this is somehow not something you
190 wish to fix), append a trailing slash to the path to avoid losing the
191 trailing whitespace.
192 .IP "\fBuse\ chroot\fP"
193 If "use chroot" is true, the rsync daemon will chroot to the "path" before
194 starting the file transfer with the client.  This has the advantage of
195 extra protection against possible implementation security holes, but it has
196 the disadvantages of requiring super-user privileges, of not being able to
197 follow symbolic links that are either absolute or outside of the new root
198 path, and of complicating the preservation of users and groups by name (see
199 below).
200 .IP
201 If \fBuse\ chroot\fP is not set, it defaults to trying to enable a chroot but
202 allows the daemon to continue (after logging a warning) if it fails. The
203 one exception to this is when a module's \fBpath\fP has a "/./" chroot
204 divider in it\ \-\- this causes an unset value to be treated as true for that
205 module.
206 .IP
207 Prior to rsync 3.2.7, the default value was "true".  The new "unset"
208 default makes it easier to setup an rsync daemon as a non-root user or to
209 run a daemon on a system where chroot fails.  Explicitly setting the value
210 to "true" in rsyncd.conf will always require the chroot to succeed.
211 .IP
212 It is also possible to specify a dot-dir in the module's "path" to
213 indicate that you want to chdir to the earlier part of the path and then
214 serve files from inside the latter part of the path (with sanitizing and
215 default symlink munging).  This can be useful if you need some library dirs
216 inside the chroot (typically for uid & gid lookups) but don't want to put
217 the lib dir into the top of the served path (even though they can be hidden
218 with an \fBexclude\fP directive).  However, a better choice for a modern
219 rsync setup is to use a \fBname\ converter\fP" and try to avoid inner lib
220 dirs altogether.  See also the \fBdaemon\ chroot\fP parameter, which causes
221 rsync to chroot into its own chroot area before doing any path-related
222 chrooting.
223 .IP
224 If the daemon is serving the "/" dir (either directly or due to being
225 chrooted to the module's path), rsync does not do any path sanitizing or
226 (default) munging.
227 .IP
228 When it has to limit access to a particular subdir (either due to chroot
229 being disabled or having an inside-chroot path set), rsync will munge
230 symlinks (by default) and sanitize paths.  Those that dislike munged
231 symlinks (and really, really trust their users to not break out of the
232 subdir) can disable the symlink munging via the "munge symlinks"
233 parameter.
234 .IP
235 When rsync is sanitizing paths, it trims ".." path elements from args that
236 it believes would escape the module hierarchy. It also substitutes leading
237 slashes in absolute paths with the module's path (so that options such as
238 \fB\-\-backup-dir\fP & \fB\-\-compare-dest\fP interpret an absolute path as rooted in
239 the module's "path" dir).
240 .IP
241 When a chroot is in effect \fIand\fP the "name converter" parameter is
242 \fInot\fP set, the "numeric ids" parameter will default to being enabled
243 (disabling name lookups).  This means that if you manually setup
244 name-lookup libraries in your chroot (instead of using a name converter)
245 that you need to explicitly set \fBnumeric\ ids\ =\ false\fP for rsync to do name
246 lookups.
247 .IP
248 If you copy library resources into the module's chroot area, you should
249 protect them through your OS's normal user/group or ACL settings (to
250 prevent the rsync module's user from being able to change them), and then
251 hide them from the user's view via "exclude" (see how in the discussion of
252 that parameter).  However, it's easier and safer to setup a name converter.
253 .IP "\fBdaemon\ chroot\fP"
254 This parameter specifies a path to which the daemon will chroot before
255 beginning communication with clients. Module paths (and any "use chroot"
256 settings) will then be related to this one. This lets you choose if you
257 want the whole daemon to be chrooted (with this setting), just the
258 transfers to be chrooted (with "use chroot"), or both.  Keep in mind that
259 the "daemon chroot" area may need various OS/lib/etc files installed to
260 allow the daemon to function.  By default the daemon runs without any
261 chrooting.
262 .IP "\fBproxy\ protocol\fP"
263 When this parameter is enabled, all incoming connections must start with a
264 V1 or V2 proxy protocol header.  If the header is not found, the connection
265 is closed.
266 .IP
267 Setting this to \fBtrue\fP requires a proxy server to forward source IP
268 information to rsync, allowing you to log proper IP/host info and make use
269 of client-oriented IP restrictions.  The default of \fBfalse\fP means that the
270 IP information comes directly from the socket's metadata.  If rsync is not
271 behind a proxy, this should be disabled.
272 .IP
273 \fICAUTION\fP: using this option can be dangerous if you do not ensure that
274 only the proxy is allowed to connect to the rsync port.  If any non-proxied
275 connections are allowed through, the client will be able to use a modified
276 rsync to spoof any remote IP address that they desire.  You can lock this
277 down using something like iptables \fB\-uid-owner\ root\fP rules (for strict
278 localhost access), various firewall rules, or you can require password
279 authorization so that any spoofing by users will not grant extra access.
280 .IP
281 This setting is global.  If you need some modules to require this and not
282 others, then you will need to setup multiple rsync daemon processes on
283 different ports.
284 .IP "\fBname\ converter\fP"
285 This parameter lets you specify a program that will be run by the rsync
286 daemon to do user & group conversions between names & ids.  This script
287 is started prior to any chroot being setup, and runs as the daemon user
288 (not the transfer user).  You can specify a fully qualified pathname or
289 a program name that is on the $PATH.
290 .IP
291 The program can be used to do normal user & group lookups without having to
292 put any extra files into the chroot area of the module \fIor\fP you can do
293 customized conversions.
294 .IP
295 The nameconvert program has access to all of the environment variables that
296 are described in the section on \fBpre-xfer\ exec\fP.  This is useful if you
297 want to customize the conversion using information about the module and/or
298 the copy request.
299 .IP
300 There is a sample python script in the support dir named "nameconvert" that
301 implements the normal user & group lookups.  Feel free to customize it or
302 just use it as documentation to implement your own.
303 .IP "\fBnumeric\ ids\fP"
304 Enabling this parameter disables the mapping of users and groups by name
305 for the current daemon module.  This prevents the daemon from trying to
306 load any user/group-related files or libraries.  This enabling makes the
307 transfer behave as if the client had passed the \fB\-\-numeric-ids\fP
308 command-line option.  By default, this parameter is enabled for chroot
309 modules and disabled for non-chroot modules.  Also keep in mind that
310 uid/gid preservation requires the module to be running as root (see "uid")
311 or for "fake super" to be configured.
312 .IP
313 A chroot-enabled module should not have this parameter set to false unless
314 you're using a "name converter" program \fIor\fP you've taken steps to ensure
315 that the module has the necessary resources it needs to translate names and
316 that it is not possible for a user to change those resources.
317 .IP "\fBmunge\ symlinks\fP"
318 This parameter tells rsync to modify all symlinks in the same way as the
319 (non-daemon-affecting) \fB\-\-munge-links\fP command-line option (using a method
320 described below).  This should help protect your files from user trickery
321 when your daemon module is writable.  The default is disabled when
322 "use chroot" is on with an inside-chroot path of "/", OR if "daemon chroot"
323 is on, otherwise it is enabled.
324 .IP
325 If you disable this parameter on a daemon that is not read-only, there are
326 tricks that a user can play with uploaded symlinks to access
327 daemon-excluded items (if your module has any), and, if "use chroot" is
328 off, rsync can even be tricked into showing or changing data that is
329 outside the module's path (as access-permissions allow).
330 .IP
331 The way rsync disables the use of symlinks is to prefix each one with the
332 string "/rsyncd-munged/".  This prevents the links from being used as long
333 as that directory does not exist.  When this parameter is enabled, rsync
334 will refuse to run if that path is a directory or a symlink to a directory.
335 When using the "munge symlinks" parameter in a chroot area that has an
336 inside-chroot path of "/", you should add "/rsyncd-munged/" to the exclude
337 setting for the module so that a user can't try to create it.
338 .IP
339 Note:  rsync makes no attempt to verify that any pre-existing symlinks in
340 the module's hierarchy are as safe as you want them to be (unless, of
341 course, it just copied in the whole hierarchy).  If you setup an rsync
342 daemon on a new area or locally add symlinks, you can manually protect your
343 symlinks from being abused by prefixing "/rsyncd-munged/" to the start of
344 every symlink's value.  There is a perl script in the support directory of
345 the source code named "munge-symlinks" that can be used to add or remove
346 this prefix from your symlinks.
347 .IP
348 When this parameter is disabled on a writable module and "use chroot" is
349 off (or the inside-chroot path is not "/"), incoming symlinks will be
350 modified to drop a leading slash and to remove ".." path elements that
351 rsync believes will allow a symlink to escape the module's hierarchy.
352 There are tricky ways to work around this, though, so you had better trust
353 your users if you choose this combination of parameters.
354 .IP "\fBcharset\fP"
355 This specifies the name of the character set in which the module's
356 filenames are stored.  If the client uses an \fB\-\-iconv\fP option, the daemon
357 will use the value of the "charset" parameter regardless of the character
358 set the client actually passed.  This allows the daemon to support charset
359 conversion in a chroot module without extra files in the chroot area, and
360 also ensures that name-translation is done in a consistent manner.  If the
361 "charset" parameter is not set, the \fB\-\-iconv\fP option is refused, just as if
362 "iconv" had been specified via "refuse options".
363 .IP
364 If you wish to force users to always use \fB\-\-iconv\fP for a particular module,
365 add "no-iconv" to the "refuse options" parameter.  Keep in mind that this
366 will restrict access to your module to very new rsync clients.
367 .IP "\fBmax\ connections\fP"
368 This parameter allows you to specify the maximum number of simultaneous
369 connections you will allow.  Any clients connecting when the maximum has
370 been reached will receive a message telling them to try later.  The default
371 is 0, which means no limit.  A negative value disables the module.  See
372 also the "lock file" parameter.
373 .IP "\fBlog\ file\fP"
374 When the "log file" parameter is set to a non-empty string, the rsync
375 daemon will log messages to the indicated file rather than using syslog.
376 This is particularly useful on systems (such as AIX) where \fBsyslog()\fP
377 doesn't work for chrooted programs.  The file is opened before \fBchroot()\fP
378 is called, allowing it to be placed outside the transfer.  If this value is
379 set on a per-module basis instead of globally, the global log will still
380 contain any authorization failures or config-file error messages.
381 .IP
382 If the daemon fails to open the specified file, it will fall back to using
383 syslog and output an error about the failure.  (Note that the failure to
384 open the specified log file used to be a fatal error.)
385 .IP
386 This setting can be overridden by using the \fB\-\-log-file=FILE\fP or
387 \fB\-\-dparam=logfile=FILE\fP command-line options.  The former overrides all the
388 log-file parameters of the daemon and all module settings.  The latter sets
389 the daemon's log file and the default for all the modules, which still
390 allows modules to override the default setting.
391 .IP "\fBsyslog\ facility\fP"
392 This parameter allows you to specify the syslog facility name to use when
393 logging messages from the rsync daemon. You may use any standard syslog
394 facility name which is defined on your system. Common names are auth,
395 authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user,
396 uucp, local0, local1, local2, local3, local4, local5, local6 and local7.
397 The default is daemon.  This setting has no effect if the "log file"
398 setting is a non-empty string (either set in the per-modules settings, or
399 inherited from the global settings).
400 .IP "\fBsyslog\ tag\fP"
401 This parameter allows you to specify the syslog tag to use when logging
402 messages from the rsync daemon. The default is "rsyncd".  This setting has
403 no effect if the "log file" setting is a non-empty string (either set in
404 the per-modules settings, or inherited from the global settings).
405 .IP
406 For example, if you wanted each authenticated user's name to be included in
407 the syslog tag, you could do something like this:
408 .RS 4
409 .IP
410 .nf
411 syslog tag = rsyncd.%RSYNC_USER_NAME%
412 .fi
413 .RE
414 .IP "\fBmax\ verbosity\fP"
415 This parameter allows you to control the maximum amount of verbose
416 information that you'll allow the daemon to generate (since the information
417 goes into the log file). The default is 1, which allows the client to
418 request one level of verbosity.
419 .IP
420 This also affects the user's ability to request higher levels of \fB\-\-info\fP
421 and \fB\-\-debug\fP logging.  If the max value is 2, then no info and/or debug
422 value that is higher than what would be set by \fB\-vv\fP will be honored by the
423 daemon in its logging.  To see how high of a verbosity level you need to
424 accept for a particular info/debug level, refer to \fBrsync\ \-\-info=help\fP and
425 \fBrsync\ \-\-debug=help\fP.  For instance, it takes max-verbosity 4 to be able to
426 output debug TIME2 and FLIST3.
427 .IP "\fBlock\ file\fP"
428 This parameter specifies the file to use to support the "max connections"
429 parameter. The rsync daemon uses record locking on this file to ensure that
430 the max connections limit is not exceeded for the modules sharing the lock
431 file.  The default is \fB/var/run/rsyncd.lock\fP.
432 .IP "\fBread\ only\fP"
433 This parameter determines whether clients will be able to upload files or
434 not. If "read only" is true then any attempted uploads will fail. If
435 "read only" is false then uploads will be possible if file permissions on
436 the daemon side allow them. The default is for all modules to be read only.
437 .IP
438 Note that "auth users" can override this setting on a per-user basis.
439 .IP "\fBwrite\ only\fP"
440 This parameter determines whether clients will be able to download files or
441 not. If "write only" is true then any attempted downloads will fail. If
442 "write only" is false then downloads will be possible if file permissions
443 on the daemon side allow them.  The default is for this parameter to be
444 disabled.
445 .IP
446 Helpful hint: you probably want to specify "refuse options = delete" for a
447 write-only module.
448 .IP "\fBopen\ noatime\fP"
449 When set to True, this parameter tells the rsync daemon to open files with
450 the O_NOATIME flag
451 (on systems that support it) to avoid changing the access time of the files
452 that are being transferred.  If your OS does not support the O_NOATIME flag
453 then rsync will silently ignore this option.  Note also that some
454 filesystems are mounted to avoid updating the atime on read access even
455 without the O_NOATIME flag being set.
456 .IP
457 When set to False, this parameters ensures that files on the server are not
458 opened with O_NOATIME.
459 .IP
460 When set to Unset (the default) the user controls the setting via
461 \fB\-\-open-noatime\fP.
462 .IP "\fBlist\fP"
463 This parameter determines whether this module is listed when the client
464 asks for a listing of available modules.  In addition, if this is false,
465 the daemon will pretend the module does not exist when a client denied by
466 "hosts allow" or "hosts deny" attempts to access it.  Realize that if
467 "reverse lookup" is disabled globally but enabled for the module, the
468 resulting reverse lookup to a potentially client-controlled DNS server may
469 still reveal to the client that it hit an existing module.  The default is
470 for modules to be listable.
471 .IP "\fBuid\fP"
472 This parameter specifies the user name or user ID that file transfers to
473 and from that module should take place as when the daemon was run as root.
474 In combination with the "gid" parameter this determines what file
475 permissions are available. The default when run by a super-user is to
476 switch to the system's "nobody" user.  The default for a non-super-user is
477 to not try to change the user.  See also the "gid" parameter.
478 .IP
479 The RSYNC_USER_NAME environment variable may be used to request that rsync
480 run as the authorizing user.  For example, if you want a rsync to run as
481 the same user that was received for the rsync authentication, this setup is
482 useful:
483 .RS 4
484 .IP
485 .nf
486 uid = %RSYNC_USER_NAME%
487 gid = *
488 .fi
489 .RE
490 .IP "\fBgid\fP"
491 This parameter specifies one or more group names/IDs that will be used when
492 accessing the module.  The first one will be the default group, and any
493 extra ones be set as supplemental groups.  You may also specify a "\fB*\fP" as
494 the first gid in the list, which will be replaced by all the normal groups
495 for the transfer's user (see "uid").  The default when run by a super-user
496 is to switch to your OS's "nobody" (or perhaps "nogroup") group with no
497 other supplementary groups.  The default for a non-super-user is to not
498 change any group attributes (and indeed, your OS may not allow a
499 non-super-user to try to change their group settings).
500 .IP
501 The specified list is normally split into tokens based on spaces and
502 commas.  However, if the list starts with a comma, then the list is only
503 split on commas, which allows a group name to contain a space.  In either
504 case any leading and/or trailing whitespace is removed from the tokens and
505 empty tokens are ignored.
506 .IP "\fBdaemon\ uid\fP"
507 This parameter specifies a uid under which the daemon will run. The daemon
508 usually runs as user root, and when this is left unset the user is left
509 unchanged. See also the "uid" parameter.
510 .IP "\fBdaemon\ gid\fP"
511 This parameter specifies a gid under which the daemon will run. The daemon
512 usually runs as group root, and when this is left unset, the group is left
513 unchanged. See also the "gid" parameter.
514 .IP "\fBfake\ super\fP"
515 Setting "fake super = yes" for a module causes the daemon side to behave as
516 if the \fB\-\-fake-super\fP command-line option had been specified.  This allows
517 the full attributes of a file to be stored without having to have the
518 daemon actually running as root.
519 .IP "\fBfilter\fP"
520 The daemon has its own filter chain that determines what files it will let
521 the client access.  This chain is not sent to the client and is independent
522 of any filters the client may have specified.  Files excluded by the daemon
523 filter chain (\fBdaemon-excluded\fP files) are treated as non-existent if the
524 client tries to pull them, are skipped with an error message if the client
525 tries to push them (triggering exit code 23), and are never deleted from
526 the module.  You can use daemon filters to prevent clients from downloading
527 or tampering with private administrative files, such as files you may add
528 to support uid/gid name translations.
529 .IP
530 The daemon filter chain is built from the "filter", "include from",
531 "include", "exclude from", and "exclude" parameters, in that order of
532 priority.  Anchored patterns are anchored at the root of the module.  To
533 prevent access to an entire subtree, for example, "\fB/secret\fP", you \fBmust\fP
534 exclude everything in the subtree; the easiest way to do this is with a
535 triple-star pattern like "\fB/secret/***\fP".
536 .IP
537 The "filter" parameter takes a space-separated list of daemon filter rules,
538 though it is smart enough to know not to split a token at an internal space
539 in a rule (e.g. "\fB\-\ /foo\ \ \-\ /bar\fP" is parsed as two rules).  You may specify
540 one or more merge-file rules using the normal syntax.  Only one "filter"
541 parameter can apply to a given module in the config file, so put all the
542 rules you want in a single parameter.  Note that per-directory merge-file
543 rules do not provide as much protection as global rules, but they can be
544 used to make \fB\-\-delete\fP work better during a client download operation if
545 the per-dir merge files are included in the transfer and the client
546 requests that they be used.
547 .IP "\fBexclude\fP"
548 This parameter takes a space-separated list of daemon exclude patterns.  As
549 with the client \fB\-\-exclude\fP option, patterns can be qualified with "\fB\-\ \fP" or
550 "\fB+\ \fP" to explicitly indicate exclude/include.  Only one "exclude" parameter
551 can apply to a given module.  See the "filter" parameter for a description
552 of how excluded files affect the daemon.
553 .IP "\fBinclude\fP"
554 Use an "include" to override the effects of the "exclude" parameter.  Only
555 one "include" parameter can apply to a given module.  See the "filter"
556 parameter for a description of how excluded files affect the daemon.
557 .IP "\fBexclude\ from\fP"
558 This parameter specifies the name of a file on the daemon that contains
559 daemon exclude patterns, one per line.  Only one "exclude from" parameter
560 can apply to a given module; if you have multiple exclude-from files, you
561 can specify them as a merge file in the "filter" parameter.  See the
562 "filter" parameter for a description of how excluded files affect the
563 daemon.
564 .IP "\fBinclude\ from\fP"
565 Analogue of "exclude from" for a file of daemon include patterns.  Only one
566 "include from" parameter can apply to a given module.  See the "filter"
567 parameter for a description of how excluded files affect the daemon.
568 .IP "\fBincoming\ chmod\fP"
569 This parameter allows you to specify a set of comma-separated chmod strings
570 that will affect the permissions of all incoming files (files that are
571 being received by the daemon).  These changes happen after all other
572 permission calculations, and this will even override destination-default
573 and/or existing permissions when the client does not specify \fB\-\-perms\fP.
574 See the description of the \fB\-\-chmod\fP rsync option and the \fBchmod\fP(1)
575 manpage for information on the format of this string.
576 .IP "\fBoutgoing\ chmod\fP"
577 This parameter allows you to specify a set of comma-separated chmod strings
578 that will affect the permissions of all outgoing files (files that are
579 being sent out from the daemon).  These changes happen first, making the
580 sent permissions appear to be different than those stored in the filesystem
581 itself.  For instance, you could disable group write permissions on the
582 server while having it appear to be on to the clients.  See the description
583 of the \fB\-\-chmod\fP rsync option and the \fBchmod\fP(1) manpage for information
584 on the format of this string.
585 .IP "\fBauth\ users\fP"
586 This parameter specifies a comma and/or space-separated list of
587 authorization rules.  In its simplest form, you list the usernames that
588 will be allowed to connect to this module. The usernames do not need to
589 exist on the local system. The rules may contain shell wildcard characters
590 that will be matched against the username provided by the client for
591 authentication. If "auth users" is set then the client will be challenged
592 to supply a username and password to connect to the module. A challenge
593 response authentication protocol is used for this exchange. The plain text
594 usernames and passwords are stored in the file specified by the
595 "secrets file" parameter. The default is for all users to be able to
596 connect without a password (this is called "anonymous rsync").
597 .IP
598 In addition to username matching, you can specify groupname matching via a
599 \&'@' prefix.  When using groupname matching, the authenticating username
600 must be a real user on the system, or it will be assumed to be a member of
601 no groups.  For example, specifying "@rsync" will match the authenticating
602 user if the named user is a member of the rsync group.
603 .IP
604 Finally, options may be specified after a colon (:).  The options allow you
605 to "deny" a user or a group, set the access to "ro" (read-only), or set the
606 access to "rw" (read/write).  Setting an auth-rule-specific ro/rw setting
607 overrides the module's "read only" setting.
608 .IP
609 Be sure to put the rules in the order you want them to be matched, because
610 the checking stops at the first matching user or group, and that is the
611 only auth that is checked.  For example:
612 .RS 4
613 .IP
614 .nf
615 auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam
616 .fi
617 .RE
618 .IP
619 In the above rule, user joe will be denied access no matter what.  Any user
620 that is in the group "guest" is also denied access.  The user "admin" gets
621 access in read/write mode, but only if the admin user is not in group
622 "guest" (because the admin user-matching rule would never be reached if the
623 user is in group "guest").  Any other user who is in group "rsync" will get
624 read-only access.  Finally, users susan, joe, and sam get the ro/rw setting
625 of the module, but only if the user didn't match an earlier group-matching
626 rule.
627 .IP
628 If you need to specify a user or group name with a space in it, start your
629 list with a comma to indicate that the list should only be split on commas
630 (though leading and trailing whitespace will also be removed, and empty
631 entries are just ignored).  For example:
632 .RS 4
633 .IP
634 .nf
635 auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro
636 .fi
637 .RE
638 .IP
639 See the description of the secrets file for how you can have per-user
640 passwords as well as per-group passwords.  It also explains how a user can
641 authenticate using their user password or (when applicable) a group
642 password, depending on what rule is being authenticated.
643 .IP
644 See also the section entitled "USING RSYNC-DAEMON FEATURES VIA A REMOTE
645 SHELL CONNECTION" in \fBrsync\fP(1) for information on how handle an
646 rsyncd.conf-level username that differs from the remote-shell-level
647 username when using a remote shell to connect to an rsync daemon.
648 .IP "\fBsecrets\ file\fP"
649 This parameter specifies the name of a file that contains the
650 username:password and/or @groupname:password pairs used for authenticating
651 this module. This file is only consulted if the "auth users" parameter is
652 specified.  The file is line-based and contains one name:password pair per
653 line.  Any line has a hash (#) as the very first character on the line is
654 considered a comment and is skipped.  The passwords can contain any
655 characters but be warned that many operating systems limit the length of
656 passwords that can be typed at the client end, so you may find that
657 passwords longer than 8 characters don't work.
658 .IP
659 The use of group-specific lines are only relevant when the module is being
660 authorized using a matching "@groupname" rule.  When that happens, the user
661 can be authorized via either their "username:password" line or the
662 "@groupname:password" line for the group that triggered the authentication.
663 .IP
664 It is up to you what kind of password entries you want to include, either
665 users, groups, or both.  The use of group rules in "auth users" does not
666 require that you specify a group password if you do not want to use shared
667 passwords.
668 .IP
669 There is no default for the "secrets file" parameter, you must choose a
670 name (such as \fB/etc/rsyncd.secrets\fP).  The file must normally not be
671 readable by "other"; see "strict modes".  If the file is not found or is
672 rejected, no logins for an "auth users" module will be possible.
673 .IP "\fBstrict\ modes\fP"
674 This parameter determines whether or not the permissions on the secrets
675 file will be checked.  If "strict modes" is true, then the secrets file
676 must not be readable by any user ID other than the one that the rsync
677 daemon is running under.  If "strict modes" is false, the check is not
678 performed.  The default is true.  This parameter was added to accommodate
679 rsync running on the Windows operating system.
680 .IP "\fBhosts\ allow\fP"
681 This parameter allows you to specify a list of comma- and/or
682 whitespace-separated patterns that are matched against a connecting
683 client's hostname and IP address.  If none of the patterns match, then the
684 connection is rejected.
685 .IP
686 Each pattern can be in one of six forms:
687 .IP
688 .RS
689 .IP o
690 a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of
691 the form a:b:c::d:e:f. In this case the incoming machine's IP address
692 must match exactly.
693 .IP o
694 an address/mask in the form ipaddr/n where ipaddr is the IP address and n
695 is the number of one bits in the netmask.  All IP addresses which match
696 the masked IP address will be allowed in.
697 .IP o
698 an address/mask in the form ipaddr/maskaddr where ipaddr is the IP
699 address and maskaddr is the netmask in dotted decimal notation for IPv4,
700 or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP
701 addresses which match the masked IP address will be allowed in.
702 .IP o
703 a hostname pattern using wildcards. If the hostname of the connecting IP
704 (as determined by a reverse lookup) matches the wildcarded name (using
705 the same rules as normal Unix filename matching), the client is allowed
706 in.  This only works if "reverse lookup" is enabled (the default).
707 .IP o
708 a hostname. A plain hostname is matched against the reverse DNS of the
709 connecting IP (if "reverse lookup" is enabled), and/or the IP of the
710 given hostname is matched against the connecting IP (if "forward lookup"
711 is enabled, as it is by default).  Any match will be allowed in.
712 .IP o
713 an '@' followed by a netgroup name, which will match if the reverse DNS
714 of the connecting IP is in the specified netgroup.
715 .RE
716 .IP
717 Note IPv6 link-local addresses can have a scope in the address
718 specification:
719 .RS 4
720 .IP
721 .nf
722 fe80::1%link1
723 fe80::%link1/64
724 fe80::%link1/ffff:ffff:ffff:ffff::
725 .fi
726 .RE
727 .IP
728 You can also combine "hosts allow" with "hosts deny" as a way to add
729 exceptions to your deny list.  When both parameters are specified, the
730 "hosts allow" parameter is checked first and a match results in the client
731 being able to connect.  A non-allowed host is then matched against the
732 "hosts deny" list to see if it should be rejected.  A host that does not
733 match either list is allowed to connect.
734 .IP
735 The default is no "hosts allow" parameter, which means all hosts can
736 connect.
737 .IP "\fBhosts\ deny\fP"
738 This parameter allows you to specify a list of comma- and/or
739 whitespace-separated patterns that are matched against a connecting clients
740 hostname and IP address. If the pattern matches then the connection is
741 rejected. See the "hosts allow" parameter for more information.
742 .IP
743 The default is no "hosts deny" parameter, which means all hosts can
744 connect.
745 .IP "\fBreverse\ lookup\fP"
746 Controls whether the daemon performs a reverse lookup on the client's IP
747 address to determine its hostname, which is used for "hosts allow" &
748 "hosts deny" checks and the "%h" log escape.  This is enabled by default,
749 but you may wish to disable it to save time if you know the lookup will not
750 return a useful result, in which case the daemon will use the name
751 "UNDETERMINED" instead.
752 .IP
753 If this parameter is enabled globally (even by default), rsync performs the
754 lookup as soon as a client connects, so disabling it for a module will not
755 avoid the lookup.  Thus, you probably want to disable it globally and then
756 enable it for modules that need the information.
757 .IP "\fBforward\ lookup\fP"
758 Controls whether the daemon performs a forward lookup on any hostname
759 specified in an hosts allow/deny setting.  By default this is enabled,
760 allowing the use of an explicit hostname that would not be returned by
761 reverse DNS of the connecting IP.
762 .IP "\fBignore\ errors\fP"
763 This parameter tells rsyncd to ignore I/O errors on the daemon when
764 deciding whether to run the delete phase of the transfer. Normally rsync
765 skips the \fB\-\-delete\fP step if any I/O errors have occurred in order to
766 prevent disastrous deletion due to a temporary resource shortage or other
767 I/O error. In some cases this test is counter productive so you can use
768 this parameter to turn off this behavior.
769 .IP "\fBignore\ nonreadable\fP"
770 This tells the rsync daemon to completely ignore files that are not
771 readable by the user. This is useful for public archives that may have some
772 non-readable files among the directories, and the sysadmin doesn't want
773 those files to be seen at all.
774 .IP "\fBtransfer\ logging\fP"
775 This parameter enables per-file logging of downloads and uploads in a
776 format somewhat similar to that used by ftp daemons.  The daemon always
777 logs the transfer at the end, so if a transfer is aborted, no mention will
778 be made in the log file.
779 .IP
780 If you want to customize the log lines, see the "log format" parameter.
781 .IP "\fBlog\ format\fP"
782 This parameter allows you to specify the format used for logging file
783 transfers when transfer logging is enabled.  The format is a text string
784 containing embedded single-character escape sequences prefixed with a
785 percent (%) character.  An optional numeric field width may also be
786 specified between the percent and the escape letter (e.g.
787 "\fB%\-50n\ %8l\ %07p\fP").  In addition, one or more apostrophes may be specified
788 prior to a numerical escape to indicate that the numerical value should be
789 made more human-readable.  The 3 supported levels are the same as for the
790 \fB\-\-human-readable\fP command-line option, though the default is for
791 human-readability to be off.  Each added apostrophe increases the level
792 (e.g. "\fB%''l\ %'b\ %f\fP").
793 .IP
794 The default log format is "\fB%o\ %h\ [%a]\ %m\ (%u)\ %f\ %l\fP", and a "\fB%t\ [%p]\ \fP"
795 is always prefixed when using the "log file" parameter.  (A perl script
796 that will summarize this default log format is included in the rsync source
797 code distribution in the "support" subdirectory: rsyncstats.)
798 .IP
799 The single-character escapes that are understood are as follows:
800 .IP
801 .RS
802 .IP o
803 %a the remote IP address (only available for a daemon)
804 .IP o
805 %b the number of bytes actually transferred
806 .IP o
807 %B the permission bits of the file (e.g. rwxrwxrwt)
808 .IP o
809 %c the total size of the block checksums received for the basis file
810 (only when sending)
811 .IP o
812 %C the full-file checksum if it is known for the file. For older rsync
813 protocols/versions, the checksum was salted, and is thus not a useful
814 value (and is not displayed when that is the case). For the checksum to
815 output for a file, either the \fB\-\-checksum\fP option must be in-effect or
816 the file must have been transferred without a salted checksum being used.
817 See the \fB\-\-checksum-choice\fP option for a way to choose the algorithm.
818 .IP o
819 %f the filename (long form on sender; no trailing "/")
820 .IP o
821 %G the gid of the file (decimal) or "DEFAULT"
822 .IP o
823 %h the remote host name (only available for a daemon)
824 .IP o
825 %i an itemized list of what is being updated
826 .IP o
827 %l the length of the file in bytes
828 .IP o
829 %L the string "\fB\ \->\ SYMLINK\fP", "\fB\ =>\ HARDLINK\fP", or "" (where \fBSYMLINK\fP
830 or \fBHARDLINK\fP is a filename)
831 .IP o
832 %m the module name
833 .IP o
834 %M the last-modified time of the file
835 .IP o
836 %n the filename (short form; trailing "/" on dir)
837 .IP o
838 %o the operation, which is "send", "recv", or "del." (the latter includes
839 the trailing period)
840 .IP o
841 %p the process ID of this rsync session
842 .IP o
843 %P the module path
844 .IP o
845 %t the current date time
846 .IP o
847 %u the authenticated username or an empty string
848 .IP o
849 %U the uid of the file (decimal)
850 .RE
851 .IP
852 For a list of what the characters mean that are output by "%i", see the
853 \fB\-\-itemize-changes\fP option in the rsync manpage.
854 .IP
855 Note that some of the logged output changes when talking with older rsync
856 versions.  For instance, deleted files were only output as verbose messages
857 prior to rsync 2.6.4.
858 .IP "\fBtimeout\fP"
859 This parameter allows you to override the clients choice for I/O timeout
860 for this module. Using this parameter you can ensure that rsync won't wait
861 on a dead client forever. The timeout is specified in seconds. A value of
862 zero means no timeout and is the default. A good choice for anonymous rsync
863 daemons may be 600 (giving a 10 minute timeout).
864 .IP "\fBrefuse\ options\fP"
865 This parameter allows you to specify a space-separated list of rsync
866 command-line options that will be refused by your rsync daemon.  You may
867 specify the full option name, its one-letter abbreviation, or a wild-card
868 string that matches multiple options. Beginning in 3.2.0, you can also
869 negate a match term by starting it with a "!".
870 .IP
871 When an option is refused, the daemon prints an error message and exits.
872 .IP
873 For example, this would refuse \fB\-\-checksum\fP (\fB\-c\fP) and all the various
874 delete options:
875 .RS 4
876 .IP
877 .nf
878 refuse options = c delete
879 .fi
880 .RE
881 .IP
882 The reason the above refuses all delete options is that the options imply
883 \fB\-\-delete\fP, and implied options are refused just like explicit options.
884 .IP
885 The use of a negated match allows you to fine-tune your refusals after a
886 wild-card, such as this:
887 .RS 4
888 .IP
889 .nf
890 refuse options = delete-* !delete-during
891 .fi
892 .RE
893 .IP
894 Negated matching can also turn your list of refused options into a list of
895 accepted options. To do this, begin the list with a "\fB*\fP" (to refuse all
896 options) and then specify one or more negated matches to accept.  For
897 example:
898 .RS 4
899 .IP
900 .nf
901 refuse options = * !a !v !compress*
902 .fi
903 .RE
904 .IP
905 Don't worry that the "\fB*\fP" will refuse certain vital options such as
906 \fB\-\-dry-run\fP, \fB\-\-server\fP, \fB\-\-no-iconv\fP, \fB\-\-seclude-args\fP, etc. These
907 important options are not matched by wild-card, so they must be overridden
908 by their exact name.  For instance, if you're forcing iconv transfers you
909 could use something like this:
910 .RS 4
911 .IP
912 .nf
913 refuse options = * no-iconv !a !v
914 .fi
915 .RE
916 .IP
917 As an additional aid (beginning in 3.2.0), refusing (or "\fB!refusing\fP") the
918 "a" or "archive"  option also affects all the options that the \fB\-\-archive\fP
919 option implies (\fB\-rdlptgoD\fP), but only if the option  is matched explicitly
920 (not using a wildcard). If you want to do something tricky, you can use
921 "\fBarchive*\fP" to avoid this side-effect, but keep in mind that no normal
922 rsync client ever sends the actual archive option to the server.
923 .IP
924 As an additional safety feature, the refusal of "delete" also refuses
925 \fBremove-source-files\fP when the daemon is the sender; if you want the latter
926 without the former, instead refuse "\fBdelete-*\fP" as that refuses all the
927 delete modes without affecting \fB\-\-remove-source-files\fP. (Keep in mind that
928 the client's \fB\-\-delete\fP option typically results in \fB\-\-delete-during\fP.)
929 .IP
930 When un-refusing delete options, you should either specify "\fB!delete*\fP" (to
931 accept all delete options) or specify a limited set that includes "delete",
932 such as:
933 .RS 4
934 .IP
935 .nf
936 refuse options = * !a !delete !delete-during
937 .fi
938 .RE
939 .IP
940 \&... whereas this accepts any delete option except \fB\-\-delete-after\fP:
941 .RS 4
942 .IP
943 .nf
944 refuse options = * !a !delete* delete-after
945 .fi
946 .RE
947 .IP
948 A note on refusing "compress": it may be better to set the "dont compress"
949 daemon parameter to "\fB*\fP" and ensure that \fBRSYNC_COMPRESS_LIST=zlib\fP is set
950 in the environment of the daemon in order to disable compression silently
951 instead of returning an error that forces the client to remove the \fB\-z\fP
952 option.
953 .IP
954 If you are un-refusing the compress option, you may want to match
955 "\fB!compress*\fP" if you also want to allow the \fB\-\-compress-level\fP option.
956 .IP
957 Note that the "copy-devices" & "write-devices" options are refused by
958 default, but they can be explicitly accepted with "\fB!copy-devices\fP" and/or
959 "\fB!write-devices\fP".  The options "log-file" and "log-file-format" are
960 forcibly refused and cannot be accepted.
961 .IP
962 Here are all the options that are not matched by wild-cards:
963 .IP
964 .RS
965 .IP o
966 \fB\-\-server\fP: Required for rsync to even work.
967 .IP o
968 \fB\-\-rsh\fP, \fB\-e\fP: Required to convey compatibility flags to the server.
969 .IP o
970 \fB\-\-out-format\fP: This is required to convey output behavior to a remote
971 receiver.  While rsync passes the older alias \fB\-\-log-format\fP for
972 compatibility reasons, this options should not be confused with
973 \fB\-\-log-file-format\fP.
974 .IP o
975 \fB\-\-sender\fP: Use "write only" parameter instead of refusing this.
976 .IP o
977 \fB\-\-dry-run\fP, \fB\-n\fP: Who would want to disable this?
978 .IP o
979 \fB\-\-seclude-args\fP, \fB\-s\fP: Is the oldest arg-protection method.
980 .IP o
981 \fB\-\-from0\fP, \fB\-0\fP: Makes it easier to accept/refuse \fB\-\-files-from\fP without
982 affecting this helpful modifier.
983 .IP o
984 \fB\-\-iconv\fP: This is auto-disabled based on "charset" parameter.
985 .IP o
986 \fB\-\-no-iconv\fP: Most transfers use this option.
987 .IP o
988 \fB\-\-checksum-seed\fP: Is a fairly rare, safe option.
989 .IP o
990 \fB\-\-write-devices\fP: Is non-wild but also auto-disabled.
991 .RE
992 .IP "\fBdont\ compress\fP"
993 \fBNOTE:\fP This parameter currently has no effect except in one instance: if
994 it is set to "\fB*\fP" then it minimizes or disables compression for all files
995 (for those that don't want to refuse the \fB\-\-compress\fP option completely).
996 .IP
997 This parameter allows you to select filenames based on wildcard patterns
998 that should not be compressed when pulling files from the daemon (no
999 analogous parameter exists to govern the pushing of files to a daemon).
1000 Compression can be expensive in terms of CPU usage, so it is usually good
1001 to not try to compress files that won't compress well, such as already
1002 compressed files.
1003 .IP
1004 The "dont compress" parameter takes a space-separated list of
1005 case-insensitive wildcard patterns. Any source filename matching one of the
1006 patterns will be compressed as little as possible during the transfer.  If
1007 the compression algorithm has an "off" level, then no compression occurs
1008 for those files.  If an algorithms has the ability to change the level in
1009 mid-stream, it will be minimized to reduce the CPU usage as much as
1010 possible.
1011 .IP
1012 See the \fB\-\-skip-compress\fP parameter in the \fBrsync\fP(1) manpage for the
1013 list of file suffixes that are skipped by default if this parameter is not
1014 set.
1015 .IP "\fBearly\ exec\fP, \fBpre-xfer\ exec\fP, \fBpost-xfer\ exec\fP"
1016 You may specify a command to be run in the early stages of the connection,
1017 or right before and/or after the transfer.  If the \fBearly\ exec\fP or
1018 \fBpre-xfer\ exec\fP command returns an error code, the transfer is aborted
1019 before it begins.  Any output from the \fBpre-xfer\ exec\fP command on stdout
1020 (up to several KB) will be displayed to the user when aborting, but is
1021 \fInot\fP displayed if the script returns success.  The other programs cannot
1022 send any text to the user.  All output except for the \fBpre-xfer\ exec\fP
1023 stdout goes to the corresponding daemon's stdout/stderr, which is typically
1024 discarded.  See the \fB\-\-no-detatch\fP option for a way to see the daemon's
1025 output, which can assist with debugging.
1026 .IP
1027 Note that the \fBearly\ exec\fP command runs before any part of the transfer
1028 request is known except for the module name.  This helper script can be
1029 used to setup a disk mount or decrypt some data into a module dir, but you
1030 may need to use \fBlock\ file\fP and \fBmax\ connections\fP to avoid concurrency
1031 issues.  If the client rsync specified the \fB\-\-early-input=FILE\fP option, it
1032 can send up to about 5K of data to the stdin of the early script.  The
1033 stdin will otherwise be empty.
1034 .IP
1035 Note that the \fBpost-xfer\ exec\fP command is still run even if one of the
1036 other scripts returns an error code. The \fBpre-xfer\ exec\fP command will \fInot\fP
1037 be run, however, if the \fBearly\ exec\fP command fails.
1038 .IP
1039 The following environment variables will be set, though some are specific
1040 to the pre-xfer or the post-xfer environment:
1041 .IP
1042 .RS
1043 .IP o
1044 \fBRSYNC_MODULE_NAME\fP: The name of the module being accessed.
1045 .IP o
1046 \fBRSYNC_MODULE_PATH\fP: The path configured for the module.
1047 .IP o
1048 \fBRSYNC_HOST_ADDR\fP: The accessing host's IP address.
1049 .IP o
1050 \fBRSYNC_HOST_NAME\fP: The accessing host's name.
1051 .IP o
1052 \fBRSYNC_USER_NAME\fP: The accessing user's name (empty if no user).
1053 .IP o
1054 \fBRSYNC_PID\fP: A unique number for this transfer.
1055 .IP o
1056 \fBRSYNC_REQUEST\fP: (pre-xfer only) The module/path info specified by the
1057 user.  Note that the user can specify multiple source files, so the
1058 request can be something like "mod/path1 mod/path2", etc.
1059 .IP o
1060 \fBRSYNC_ARG#\fP: (pre-xfer only) The pre-request arguments are set in these
1061 numbered values. RSYNC_ARG0 is always "rsyncd", followed by the options
1062 that were used in RSYNC_ARG1, and so on.  There will be a value of "."
1063 indicating that the options are done and the path args are beginning\ \-\-
1064 these contain similar information to RSYNC_REQUEST, but with values
1065 separated and the module name stripped off.
1066 .IP o
1067 \fBRSYNC_EXIT_STATUS\fP: (post-xfer only) the server side's exit value.  This
1068 will be 0 for a successful run, a positive value for an error that the
1069 server generated, or a \-1 if rsync failed to exit properly.  Note that an
1070 error that occurs on the client side does not currently get sent to the
1071 server side, so this is not the final exit status for the whole transfer.
1072 .IP o
1073 \fBRSYNC_RAW_STATUS\fP: (post-xfer only) the raw exit value from
1074 \fBwaitpid()\fP.
1075 .RE
1076 .IP
1077 Even though the commands can be associated with a particular module, they
1078 are run using the permissions of the user that started the daemon (not the
1079 module's uid/gid setting) without any chroot restrictions.
1080 .IP
1081 These settings honor 2 environment variables: use RSYNC_SHELL to set a
1082 shell to use when running the command (which otherwise uses your
1083 \fBsystem()\fP call's default shell), and use RSYNC_NO_XFER_EXEC to disable
1084 both options completely.
1085 .P
1086 .SH "CONFIG DIRECTIVES"
1087 .P
1088 There are currently two config directives available that allow a config file to
1089 incorporate the contents of other files:  \fB&include\fP and \fB&merge\fP.  Both allow
1090 a reference to either a file or a directory.  They differ in how segregated the
1091 file's contents are considered to be.
1092 .P
1093 The \fB&include\fP directive treats each file as more distinct, with each one
1094 inheriting the defaults of the parent file, starting the parameter parsing as
1095 globals/defaults, and leaving the defaults unchanged for the parsing of the
1096 rest of the parent file.
1097 .P
1098 The \fB&merge\fP directive, on the other hand, treats the file's contents as if it
1099 were simply inserted in place of the directive, and thus it can set parameters
1100 in a module started in another file, can affect the defaults for other files,
1101 etc.
1102 .P
1103 When an \fB&include\fP or \fB&merge\fP directive refers to a directory, it will read in
1104 all the \fB*.conf\fP or \fB*.inc\fP files (respectively) that are contained inside that
1105 directory (without any recursive scanning), with the files sorted into alpha
1106 order.  So, if you have a directory named "rsyncd.d" with the files "foo.conf",
1107 "bar.conf", and "baz.conf" inside it, this directive:
1108 .RS 4
1109 .P
1110 .nf
1111 &include /path/rsyncd.d
1112 .fi
1113 .RE
1114 .P
1115 would be the same as this set of directives:
1116 .RS 4
1117 .P
1118 .nf
1119 &include /path/rsyncd.d/bar.conf
1120 &include /path/rsyncd.d/baz.conf
1121 &include /path/rsyncd.d/foo.conf
1122 .fi
1123 .RE
1124 .P
1125 except that it adjusts as files are added and removed from the directory.
1126 .P
1127 The advantage of the \fB&include\fP directive is that you can define one or more
1128 modules in a separate file without worrying about unintended side-effects
1129 between the self-contained module files.
1130 .P
1131 The advantage of the \fB&merge\fP directive is that you can load config snippets
1132 that can be included into multiple module definitions, and you can also set
1133 global values that will affect connections (such as \fBmotd\ file\fP), or globals
1134 that will affect other include files.
1135 .P
1136 For example, this is a useful /etc/rsyncd.conf file:
1137 .RS 4
1138 .P
1139 .nf
1140 port = 873
1141 log file = /var/log/rsync.log
1142 pid file = /var/lock/rsync.lock
1143
1144 &merge /etc/rsyncd.d
1145 &include /etc/rsyncd.d
1146 .fi
1147 .RE
1148 .P
1149 This would merge any \fB/etc/rsyncd.d/*.inc\fP files (for global values that should
1150 stay in effect), and then include any \fB/etc/rsyncd.d/*.conf\fP files (defining
1151 modules without any global-value cross-talk).
1152 .P
1153 .SH "AUTHENTICATION STRENGTH"
1154 .P
1155 The authentication protocol used in rsync is a 128 bit MD4 based challenge
1156 response system. This is fairly weak protection, though (with at least one
1157 brute-force hash-finding algorithm publicly available), so if you want really
1158 top-quality security, then I recommend that you run rsync over ssh.  (Yes, a
1159 future version of rsync will switch over to a stronger hashing method.)
1160 .P
1161 Also note that the rsync daemon protocol does not currently provide any
1162 encryption of the data that is transferred over the connection. Only
1163 authentication is provided. Use ssh as the transport if you want encryption.
1164 .P
1165 You can also make use of SSL/TLS encryption if you put rsync behind an
1166 SSL proxy.
1167 .P
1168 .SH "SSL/TLS Daemon Setup"
1169 .P
1170 When setting up an rsync daemon for access via SSL/TLS, you will need to
1171 configure a TCP proxy (such as haproxy or nginx) as the front-end that handles
1172 the encryption.
1173 .P
1174 .IP o
1175 You should limit the access to the backend-rsyncd port to only allow the
1176 proxy to connect.  If it is on the same host as the proxy, then configuring
1177 it to only listen on localhost is a good idea.
1178 .IP o
1179 You should consider turning on the \fBproxy\ protocol\fP rsync-daemon parameter if
1180 your proxy supports sending that information.  The examples below assume that
1181 this is enabled.
1182 .P
1183 An example haproxy setup is as follows:
1184 .RS 4
1185 .P
1186 .nf
1187 frontend fe_rsync-ssl
1188    bind :::874 ssl crt /etc/letsencrypt/example.com/combined.pem
1189    mode tcp
1190    use_backend be_rsync
1191
1192 backend be_rsync
1193    mode tcp
1194    server local-rsync 127.0.0.1:873 check send-proxy
1195 .fi
1196 .RE
1197 .P
1198 An example nginx proxy setup is as follows:
1199 .RS 4
1200 .P
1201 .nf
1202 stream {
1203    server {
1204        listen 874 ssl;
1205        listen [::]:874 ssl;
1206
1207        ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;
1208        ssl_certificate_key /etc/letsencrypt/example.com/privkey.pem;
1209
1210        proxy_pass localhost:873;
1211        proxy_protocol on; # Requires rsyncd.conf "proxy protocol = true"
1212        proxy_timeout 1m;
1213        proxy_connect_timeout 5s;
1214    }
1215 }
1216 .fi
1217 .RE
1218 .P
1219 .SH "DAEMON CONFIG EXAMPLES"
1220 .P
1221 A simple rsyncd.conf file that allow anonymous rsync to a ftp area at
1222 \fB/home/ftp\fP would be:
1223 .RS 4
1224 .P
1225 .nf
1226 [ftp]
1227         path = /home/ftp
1228         comment = ftp export area
1229 .fi
1230 .RE
1231 .P
1232 A more sophisticated example would be:
1233 .RS 4
1234 .P
1235 .nf
1236 uid = nobody
1237 gid = nobody
1238 use chroot = yes
1239 max connections = 4
1240 syslog facility = local5
1241 pid file = /var/run/rsyncd.pid
1242
1243 [ftp]
1244         path = /var/ftp/./pub
1245         comment = whole ftp area (approx 6.1 GB)
1246
1247 [sambaftp]
1248         path = /var/ftp/./pub/samba
1249         comment = Samba ftp area (approx 300 MB)
1250
1251 [rsyncftp]
1252         path = /var/ftp/./pub/rsync
1253         comment = rsync ftp area (approx 6 MB)
1254
1255 [sambawww]
1256         path = /public_html/samba
1257         comment = Samba WWW pages (approx 240 MB)
1258
1259 [cvs]
1260         path = /data/cvs
1261         comment = CVS repository (requires authentication)
1262         auth users = tridge, susan
1263         secrets file = /etc/rsyncd.secrets
1264 .fi
1265 .RE
1266 .P
1267 The /etc/rsyncd.secrets file would look something like this:
1268 .RS 4
1269 .P
1270 .nf
1271 tridge:mypass
1272 susan:herpass
1273 .fi
1274 .RE
1275 .P
1276 .SH "FILES"
1277 .P
1278 /etc/rsyncd.conf or rsyncd.conf
1279 .P
1280 .SH "SEE ALSO"
1281 .P
1282 \fBrsync\fP(1), \fBrsync-ssl\fP(1)
1283 .P
1284 .SH "BUGS"
1285 .P
1286 Please report bugs! The rsync bug tracking system is online at
1287 https://rsync.samba.org/.
1288 .P
1289 .SH "VERSION"
1290 .P
1291 This manpage is current for version 3.2.7 of rsync.
1292 .P
1293 .SH "CREDITS"
1294 .P
1295 Rsync is distributed under the GNU General Public License.  See the file
1296 COPYING for details.
1297 .P
1298 An rsync web site is available at https://rsync.samba.org/ and its github
1299 project is https://github.com/WayneD/rsync.
1300 .P
1301 .SH "THANKS"
1302 .P
1303 Thanks to Warren Stanley for his original idea and patch for the rsync daemon.
1304 Thanks to Karsten Thygesen for his many suggestions and documentation!
1305 .P
1306 .SH "AUTHOR"
1307 .P
1308 Rsync was originally written by Andrew Tridgell and Paul Mackerras.  Many
1309 people have later contributed to it. It is currently maintained by Wayne
1310 Davison.
1311 .P
1312 Mailing lists for support and development are available at
1313 https://lists.samba.org/.