Debian Codegraph @

upstream/debian-unstable/man5/rsyncd.conf.5

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