3 rsyncd.conf - configuration file for rsync in daemon mode
9 The online version of this manpage (that includes cross-linking of topics)
10 is available at <https://download.samba.org/pub/rsync/rsyncd.conf.5>.
14 The rsyncd.conf file is the runtime configuration file for rsync when run as an
17 The rsyncd.conf file controls authentication, access, logging and available
22 The file consists of modules and parameters. A module begins with the name of
23 the module in square brackets and continues until the next module begins.
24 Modules contain parameters of the form `name = value`.
26 The file is line-based -- that is, each newline-terminated line represents
27 either a comment, a module name or a parameter.
29 Only the first equals sign in a parameter is significant. Whitespace before or
30 after the first equals sign is discarded. Leading, trailing and internal
31 whitespace in module and parameter names is irrelevant. Leading and trailing
32 whitespace in a parameter value is discarded. Internal whitespace within a
33 parameter value is retained verbatim.
35 Any line **beginning** with a hash (`#`) is ignored, as are lines containing
36 only whitespace. (If a hash occurs after anything other than leading
37 whitespace, it is considered a part of the line's content.)
39 Any line ending in a `\` is "continued" on the next line in the customary UNIX
42 The values following the equals sign in parameters are all either a string (no
43 quotes needed) or a boolean, which may be given as yes/no, 0/1 or true/false.
44 Case is not significant in boolean values, but is preserved in string values.
46 ## LAUNCHING THE RSYNC DAEMON
48 The rsync daemon is launched by specifying the `--daemon` option to rsync.
50 The daemon must run with root privileges if you wish to use chroot, to bind to
51 a port numbered under 1024 (as is the default 873), or to set file ownership.
52 Otherwise, it must just have permission to read and write the appropriate data,
55 You can launch it either via inetd, as a stand-alone daemon, or from an rsync
56 client via a remote shell. If run as a stand-alone daemon then just run the
57 command "`rsync --daemon`" from a suitable startup script.
59 When run via inetd you should add a line like this to /etc/services:
63 and a single line something like this to /etc/inetd.conf:
65 > rsync stream tcp nowait root @BINDIR@/rsync rsyncd --daemon
67 Replace "@BINDIR@/rsync" with the path to where you have rsync installed on
68 your system. You will then need to send inetd a HUP signal to tell it to
69 reread its config file.
71 Note that you should **not** send the rsync daemon a HUP signal to force it to
72 reread the `rsyncd.conf` file. The file is re-read on each client connection.
76 The first parameters in the file (before a [module] header) are the global
77 parameters. Rsync also allows for the use of a "[global]" module name to
78 indicate the start of one or more global-parameter sections (the name must be
81 You may also include any module parameters in the global part of the config
82 file in which case the supplied value will override the default for that
85 You may use references to environment variables in the values of parameters.
86 String parameters will have %VAR% references expanded as late as possible (when
87 the string is first used in the program), allowing for the use of variables
88 that rsync sets at connection time, such as RSYNC_USER_NAME. Non-string
89 parameters (such as true/false settings) are expanded when read from the config
90 file. If a variable does not exist in the environment, or if a sequence of
91 characters is not a valid reference (such as an un-paired percent sign), the
92 raw characters are passed through unchanged. This helps with backward
93 compatibility and safety (e.g. expanding a non-existent %VAR% to an empty
94 string in a path could result in a very unsafe path). The safest way to insert
95 a literal % into a value is to use %%.
97 [comment]: # (An OL starting at 0 is converted into a DL by the parser.)
101 This parameter allows you to specify a "message of the day" (MOTD) to display
102 to clients on each connect. This usually contains site information and any
103 legal notices. The default is no MOTD file. This can be overridden by the
104 `--dparam=motdfile=FILE` command-line option when starting the daemon.
108 This parameter tells the rsync daemon to write its process ID to that file.
109 The rsync keeps the file locked so that it can know when it is safe to
110 overwrite an existing file.
112 The filename can be overridden by the `--dparam=pidfile=FILE` command-line
113 option when starting the daemon.
117 You can override the default port the daemon will listen on by specifying
118 this value (defaults to 873). This is ignored if the daemon is being run
119 by inetd, and is superseded by the `--port` command-line option.
123 You can override the default IP address the daemon will listen on by
124 specifying this value. This is ignored if the daemon is being run by
125 inetd, and is superseded by the `--address` command-line option.
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 **setsockopt()** 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 `--sockopts` command-line option.
138 You can override the default backlog value when the daemon listens for
139 connections. It defaults to 5.
143 After the global parameters you should define a number of modules, each module
144 exports a directory tree as a symbolic name. Modules are exported by specifying
145 a module name in square brackets [module] followed by the parameters for that
146 module. The module name cannot contain a slash or a closing square bracket.
147 If the name contains whitespace, each internal sequence of whitespace will be
148 changed into a single space, while leading or trailing whitespace will be
149 discarded. Also, the name cannot be "global" as that exact name indicates that
150 global parameters follow (see above).
152 As with GLOBAL PARAMETERS, you may use references to environment variables in
153 the values of parameters. See the GLOBAL PARAMETERS section for more details.
157 This parameter specifies a description string that is displayed next to the
158 module name when clients obtain a list of available modules. The default is
163 This parameter specifies the directory in the daemon's filesystem to make
164 available in this module. You must specify this parameter for each module
167 If the value contains a "/./" element then the path will be divided at that
168 point into a chroot dir and an inner-chroot subdir. If [`use chroot`](#)
169 is set to false, though, the extraneous dot dir is just cleaned out of the
170 path. An example of this idiom is:
172 > path = /var/rsync/./module1
174 This will (when chrooting) chroot to "/var/rsync" and set the inside-chroot
177 You may base the path's value off of an environment variable by surrounding
178 the variable name with percent signs. You can even reference a variable
179 that is set by rsync when the user connects. For example, this would use
180 the authorizing user's name in the path:
182 > path = /home/%RSYNC_USER_NAME%
184 It is fine if the path includes internal spaces -- they will be retained
185 verbatim (which means that you shouldn't try to escape them). If your
186 final directory has a trailing space (and this is somehow not something you
187 wish to fix), append a trailing slash to the path to avoid losing the
192 If "use chroot" is true, the rsync daemon will chroot to the "[path](#)" before
193 starting the file transfer with the client. This has the advantage of
194 extra protection against possible implementation security holes, but it has
195 the disadvantages of requiring super-user privileges, of not being able to
196 follow symbolic links that are either absolute or outside of the new root
197 path, and of complicating the preservation of users and groups by name (see
200 If `use chroot` is not set, it defaults to trying to enable a chroot but
201 allows the daemon to continue (after logging a warning) if it fails. The
202 one exception to this is when a module's [`path`](#) has a "/./" chroot
203 divider in it -- this causes an unset value to be treated as true for that
206 Prior to rsync 3.2.7, the default value was "true". The new "unset"
207 default makes it easier to setup an rsync daemon as a non-root user or to
208 run a daemon on a system where chroot fails. Explicitly setting the value
209 to "true" in rsyncd.conf will always require the chroot to succeed.
211 It is also possible to specify a dot-dir in the module's "[path](#)" to
212 indicate that you want to chdir to the earlier part of the path and then
213 serve files from inside the latter part of the path (with sanitizing and
214 default symlink munging). This can be useful if you need some library dirs
215 inside the chroot (typically for uid & gid lookups) but don't want to put
216 the lib dir into the top of the served path (even though they can be hidden
217 with an [`exclude`](#) directive). However, a better choice for a modern
218 rsync setup is to use a [`name converter`](#)" and try to avoid inner lib
219 dirs altogether. See also the [`daemon chroot`](#) parameter, which causes
220 rsync to chroot into its own chroot area before doing any path-related
223 If the daemon is serving the "/" dir (either directly or due to being
224 chrooted to the module's path), rsync does not do any path sanitizing or
227 When it has to limit access to a particular subdir (either due to chroot
228 being disabled or having an inside-chroot path set), rsync will munge
229 symlinks (by default) and sanitize paths. Those that dislike munged
230 symlinks (and really, really trust their users to not break out of the
231 subdir) can disable the symlink munging via the "[munge symlinks](#)"
234 When rsync is sanitizing paths, it trims ".." path elements from args that
235 it believes would escape the module hierarchy. It also substitutes leading
236 slashes in absolute paths with the module's path (so that options such as
237 `--backup-dir` & `--compare-dest` interpret an absolute path as rooted in
238 the module's "[path](#)" dir).
240 When a chroot is in effect *and* the "[name converter](#)" parameter is
241 *not* set, the "[numeric ids](#)" parameter will default to being enabled
242 (disabling name lookups). This means that if you manually setup
243 name-lookup libraries in your chroot (instead of using a name converter)
244 that you need to explicitly set `numeric ids = false` for rsync to do name
247 If you copy library resources into the module's chroot area, you should
248 protect them through your OS's normal user/group or ACL settings (to
249 prevent the rsync module's user from being able to change them), and then
250 hide them from the user's view via "[exclude](#)" (see how in the discussion of
251 that parameter). However, it's easier and safer to setup a name converter.
255 This parameter specifies a path to which the daemon will chroot before
256 beginning communication with clients. Module paths (and any "[use chroot](#)"
257 settings) will then be related to this one. This lets you choose if you
258 want the whole daemon to be chrooted (with this setting), just the
259 transfers to be chrooted (with "[use chroot](#)"), or both. Keep in mind that
260 the "daemon chroot" area may need various OS/lib/etc files installed to
261 allow the daemon to function. By default the daemon runs without any
266 When this parameter is enabled, all incoming connections must start with a
267 V1 or V2 proxy protocol header. If the header is not found, the connection
270 Setting this to `true` requires a proxy server to forward source IP
271 information to rsync, allowing you to log proper IP/host info and make use
272 of client-oriented IP restrictions. The default of `false` means that the
273 IP information comes directly from the socket's metadata. If rsync is not
274 behind a proxy, this should be disabled.
276 _CAUTION_: using this option can be dangerous if you do not ensure that
277 only the proxy is allowed to connect to the rsync port. If any non-proxied
278 connections are allowed through, the client will be able to use a modified
279 rsync to spoof any remote IP address that they desire. You can lock this
280 down using something like iptables `-uid-owner root` rules (for strict
281 localhost access), various firewall rules, or you can require password
282 authorization so that any spoofing by users will not grant extra access.
284 This setting is global. If you need some modules to require this and not
285 others, then you will need to setup multiple rsync daemon processes on
290 This parameter lets you specify a program that will be run by the rsync
291 daemon to do user & group conversions between names & ids. This script
292 is started prior to any chroot being setup, and runs as the daemon user
293 (not the transfer user). You can specify a fully qualified pathname or
294 a program name that is on the $PATH.
296 The program can be used to do normal user & group lookups without having to
297 put any extra files into the chroot area of the module *or* you can do
298 customized conversions.
300 The nameconvert program has access to all of the environment variables that
301 are described in the section on `pre-xfer exec`. This is useful if you
302 want to customize the conversion using information about the module and/or
305 There is a sample python script in the support dir named "nameconvert" that
306 implements the normal user & group lookups. Feel free to customize it or
307 just use it as documentation to implement your own.
311 Enabling this parameter disables the mapping of users and groups by name
312 for the current daemon module. This prevents the daemon from trying to
313 load any user/group-related files or libraries. This enabling makes the
314 transfer behave as if the client had passed the `--numeric-ids`
315 command-line option. By default, this parameter is enabled for chroot
316 modules and disabled for non-chroot modules. Also keep in mind that
317 uid/gid preservation requires the module to be running as root (see "[uid](#)")
318 or for "[fake super](#)" to be configured.
320 A chroot-enabled module should not have this parameter set to false unless
321 you're using a "[name converter](#)" program *or* you've taken steps to ensure
322 that the module has the necessary resources it needs to translate names and
323 that it is not possible for a user to change those resources.
327 This parameter tells rsync to modify all symlinks in the same way as the
328 (non-daemon-affecting) `--munge-links` command-line option (using a method
329 described below). This should help protect your files from user trickery
330 when your daemon module is writable. The default is disabled when
331 "[use chroot](#)" is on with an inside-chroot path of "/", OR if "[daemon chroot](#)"
332 is on, otherwise it is enabled.
334 If you disable this parameter on a daemon that is not read-only, there are
335 tricks that a user can play with uploaded symlinks to access
336 daemon-excluded items (if your module has any), and, if "[use chroot](#)" is
337 off, rsync can even be tricked into showing or changing data that is
338 outside the module's path (as access-permissions allow).
340 The way rsync disables the use of symlinks is to prefix each one with the
341 string "/rsyncd-munged/". This prevents the links from being used as long
342 as that directory does not exist. When this parameter is enabled, rsync
343 will refuse to run if that path is a directory or a symlink to a directory.
344 When using the "munge symlinks" parameter in a chroot area that has an
345 inside-chroot path of "/", you should add "/rsyncd-munged/" to the exclude
346 setting for the module so that a user can't try to create it.
348 Note: rsync makes no attempt to verify that any pre-existing symlinks in
349 the module's hierarchy are as safe as you want them to be (unless, of
350 course, it just copied in the whole hierarchy). If you setup an rsync
351 daemon on a new area or locally add symlinks, you can manually protect your
352 symlinks from being abused by prefixing "/rsyncd-munged/" to the start of
353 every symlink's value. There is a perl script in the support directory of
354 the source code named "munge-symlinks" that can be used to add or remove
355 this prefix from your symlinks.
357 When this parameter is disabled on a writable module and "[use chroot](#)" is
358 off (or the inside-chroot path is not "/"), incoming symlinks will be
359 modified to drop a leading slash and to remove ".." path elements that
360 rsync believes will allow a symlink to escape the module's hierarchy.
361 There are tricky ways to work around this, though, so you had better trust
362 your users if you choose this combination of parameters.
366 This specifies the name of the character set in which the module's
367 filenames are stored. If the client uses an `--iconv` option, the daemon
368 will use the value of the "charset" parameter regardless of the character
369 set the client actually passed. This allows the daemon to support charset
370 conversion in a chroot module without extra files in the chroot area, and
371 also ensures that name-translation is done in a consistent manner. If the
372 "charset" parameter is not set, the `--iconv` option is refused, just as if
373 "iconv" had been specified via "[refuse options](#)".
375 If you wish to force users to always use `--iconv` for a particular module,
376 add "no-iconv" to the "[refuse options](#)" parameter. Keep in mind that this
377 will restrict access to your module to very new rsync clients.
381 This parameter allows you to specify the maximum number of simultaneous
382 connections you will allow. Any clients connecting when the maximum has
383 been reached will receive a message telling them to try later. The default
384 is 0, which means no limit. A negative value disables the module. See
385 also the "[lock file](#)" parameter.
389 When the "log file" parameter is set to a non-empty string, the rsync
390 daemon will log messages to the indicated file rather than using syslog.
391 This is particularly useful on systems (such as AIX) where **syslog()**
392 doesn't work for chrooted programs. The file is opened before **chroot()**
393 is called, allowing it to be placed outside the transfer. If this value is
394 set on a per-module basis instead of globally, the global log will still
395 contain any authorization failures or config-file error messages.
397 If the daemon fails to open the specified file, it will fall back to using
398 syslog and output an error about the failure. (Note that the failure to
399 open the specified log file used to be a fatal error.)
401 This setting can be overridden by using the `--log-file=FILE` or
402 `--dparam=logfile=FILE` command-line options. The former overrides all the
403 log-file parameters of the daemon and all module settings. The latter sets
404 the daemon's log file and the default for all the modules, which still
405 allows modules to override the default setting.
409 This parameter allows you to specify the syslog facility name to use when
410 logging messages from the rsync daemon. You may use any standard syslog
411 facility name which is defined on your system. Common names are auth,
412 authpriv, cron, daemon, ftp, kern, lpr, mail, news, security, syslog, user,
413 uucp, local0, local1, local2, local3, local4, local5, local6 and local7.
414 The default is daemon. This setting has no effect if the "[log file](#)"
415 setting is a non-empty string (either set in the per-modules settings, or
416 inherited from the global settings).
420 This parameter allows you to specify the syslog tag to use when logging
421 messages from the rsync daemon. The default is "rsyncd". This setting has
422 no effect if the "[log file](#)" setting is a non-empty string (either set in
423 the per-modules settings, or inherited from the global settings).
425 For example, if you wanted each authenticated user's name to be included in
426 the syslog tag, you could do something like this:
428 > syslog tag = rsyncd.%RSYNC_USER_NAME%
432 This parameter allows you to control the maximum amount of verbose
433 information that you'll allow the daemon to generate (since the information
434 goes into the log file). The default is 1, which allows the client to
435 request one level of verbosity.
437 This also affects the user's ability to request higher levels of `--info`
438 and `--debug` logging. If the max value is 2, then no info and/or debug
439 value that is higher than what would be set by `-vv` will be honored by the
440 daemon in its logging. To see how high of a verbosity level you need to
441 accept for a particular info/debug level, refer to `rsync --info=help` and
442 `rsync --debug=help`. For instance, it takes max-verbosity 4 to be able to
443 output debug TIME2 and FLIST3.
447 This parameter specifies the file to use to support the "[max connections](#)"
448 parameter. The rsync daemon uses record locking on this file to ensure that
449 the max connections limit is not exceeded for the modules sharing the lock
450 file. The default is `/var/run/rsyncd.lock`.
454 This parameter determines whether clients will be able to upload files or
455 not. If "read only" is true then any attempted uploads will fail. If
456 "read only" is false then uploads will be possible if file permissions on
457 the daemon side allow them. The default is for all modules to be read only.
459 Note that "[auth users](#)" can override this setting on a per-user basis.
463 This parameter determines whether clients will be able to download files or
464 not. If "write only" is true then any attempted downloads will fail. If
465 "write only" is false then downloads will be possible if file permissions
466 on the daemon side allow them. The default is for this parameter to be
469 Helpful hint: you probably want to specify "refuse options = delete" for a
474 When set to True, this parameter tells the rsync daemon to open files with
476 (on systems that support it) to avoid changing the access time of the files
477 that are being transferred. If your OS does not support the O_NOATIME flag
478 then rsync will silently ignore this option. Note also that some
479 filesystems are mounted to avoid updating the atime on read access even
480 without the O_NOATIME flag being set.
482 When set to False, this parameters ensures that files on the server are not
483 opened with O_NOATIME.
485 When set to Unset (the default) the user controls the setting via
490 This parameter determines whether this module is listed when the client
491 asks for a listing of available modules. In addition, if this is false,
492 the daemon will pretend the module does not exist when a client denied by
493 "[hosts allow](#)" or "[hosts deny](#)" attempts to access it. Realize that if
494 "[reverse lookup](#)" is disabled globally but enabled for the module, the
495 resulting reverse lookup to a potentially client-controlled DNS server may
496 still reveal to the client that it hit an existing module. The default is
497 for modules to be listable.
501 This parameter specifies the user name or user ID that file transfers to
502 and from that module should take place as when the daemon was run as root.
503 In combination with the "[gid](#)" parameter this determines what file
504 permissions are available. The default when run by a super-user is to
505 switch to the system's "nobody" user. The default for a non-super-user is
506 to not try to change the user. See also the "[gid](#)" parameter.
508 The RSYNC_USER_NAME environment variable may be used to request that rsync
509 run as the authorizing user. For example, if you want a rsync to run as
510 the same user that was received for the rsync authentication, this setup is
513 > uid = %RSYNC_USER_NAME%
518 This parameter specifies one or more group names/IDs that will be used when
519 accessing the module. The first one will be the default group, and any
520 extra ones be set as supplemental groups. You may also specify a "`*`" as
521 the first gid in the list, which will be replaced by all the normal groups
522 for the transfer's user (see "[uid](#)"). The default when run by a super-user
523 is to switch to your OS's "nobody" (or perhaps "nogroup") group with no
524 other supplementary groups. The default for a non-super-user is to not
525 change any group attributes (and indeed, your OS may not allow a
526 non-super-user to try to change their group settings).
528 The specified list is normally split into tokens based on spaces and
529 commas. However, if the list starts with a comma, then the list is only
530 split on commas, which allows a group name to contain a space. In either
531 case any leading and/or trailing whitespace is removed from the tokens and
532 empty tokens are ignored.
536 This parameter specifies a uid under which the daemon will run. The daemon
537 usually runs as user root, and when this is left unset the user is left
538 unchanged. See also the "[uid](#)" parameter.
542 This parameter specifies a gid under which the daemon will run. The daemon
543 usually runs as group root, and when this is left unset, the group is left
544 unchanged. See also the "[gid](#)" parameter.
548 Setting "fake super = yes" for a module causes the daemon side to behave as
549 if the `--fake-super` command-line option had been specified. This allows
550 the full attributes of a file to be stored without having to have the
551 daemon actually running as root.
555 The daemon has its own filter chain that determines what files it will let
556 the client access. This chain is not sent to the client and is independent
557 of any filters the client may have specified. Files excluded by the daemon
558 filter chain (`daemon-excluded` files) are treated as non-existent if the
559 client tries to pull them, are skipped with an error message if the client
560 tries to push them (triggering exit code 23), and are never deleted from
561 the module. You can use daemon filters to prevent clients from downloading
562 or tampering with private administrative files, such as files you may add
563 to support uid/gid name translations.
565 The daemon filter chain is built from the "filter", "[include from](#)",
566 "[include](#)", "[exclude from](#)", and "[exclude](#)" parameters, in that order of
567 priority. Anchored patterns are anchored at the root of the module. To
568 prevent access to an entire subtree, for example, "`/secret`", you **must**
569 exclude everything in the subtree; the easiest way to do this is with a
570 triple-star pattern like "`/secret/***`".
572 The "filter" parameter takes a space-separated list of daemon filter rules,
573 though it is smart enough to know not to split a token at an internal space
574 in a rule (e.g. "`- /foo - /bar`" is parsed as two rules). You may specify
575 one or more merge-file rules using the normal syntax. Only one "filter"
576 parameter can apply to a given module in the config file, so put all the
577 rules you want in a single parameter. Note that per-directory merge-file
578 rules do not provide as much protection as global rules, but they can be
579 used to make `--delete` work better during a client download operation if
580 the per-dir merge files are included in the transfer and the client
581 requests that they be used.
585 This parameter takes a space-separated list of daemon exclude patterns. As
586 with the client `--exclude` option, patterns can be qualified with "`- `" or
587 "`+ `" to explicitly indicate exclude/include. Only one "exclude" parameter
588 can apply to a given module. See the "filter" parameter for a description
589 of how excluded files affect the daemon.
593 Use an "include" to override the effects of the "[exclude](#)" parameter. Only
594 one "include" parameter can apply to a given module. See the "[filter](#)"
595 parameter for a description of how excluded files affect the daemon.
599 This parameter specifies the name of a file on the daemon that contains
600 daemon exclude patterns, one per line. Only one "exclude from" parameter
601 can apply to a given module; if you have multiple exclude-from files, you
602 can specify them as a merge file in the "[filter](#)" parameter. See the
603 "[filter](#)" parameter for a description of how excluded files affect the
608 Analogue of "[exclude from](#)" for a file of daemon include patterns. Only one
609 "include from" parameter can apply to a given module. See the "[filter](#)"
610 parameter for a description of how excluded files affect the daemon.
614 This parameter allows you to specify a set of comma-separated chmod strings
615 that will affect the permissions of all incoming files (files that are
616 being received by the daemon). These changes happen after all other
617 permission calculations, and this will even override destination-default
618 and/or existing permissions when the client does not specify `--perms`.
619 See the description of the `--chmod` rsync option and the **chmod**(1)
620 manpage for information on the format of this string.
624 This parameter allows you to specify a set of comma-separated chmod strings
625 that will affect the permissions of all outgoing files (files that are
626 being sent out from the daemon). These changes happen first, making the
627 sent permissions appear to be different than those stored in the filesystem
628 itself. For instance, you could disable group write permissions on the
629 server while having it appear to be on to the clients. See the description
630 of the `--chmod` rsync option and the **chmod**(1) manpage for information
631 on the format of this string.
635 This parameter specifies a comma and/or space-separated list of
636 authorization rules. In its simplest form, you list the usernames that
637 will be allowed to connect to this module. The usernames do not need to
638 exist on the local system. The rules may contain shell wildcard characters
639 that will be matched against the username provided by the client for
640 authentication. If "auth users" is set then the client will be challenged
641 to supply a username and password to connect to the module. A challenge
642 response authentication protocol is used for this exchange. The plain text
643 usernames and passwords are stored in the file specified by the
644 "[secrets file](#)" parameter. The default is for all users to be able to
645 connect without a password (this is called "anonymous rsync").
647 In addition to username matching, you can specify groupname matching via a
648 '@' prefix. When using groupname matching, the authenticating username
649 must be a real user on the system, or it will be assumed to be a member of
650 no groups. For example, specifying "@rsync" will match the authenticating
651 user if the named user is a member of the rsync group.
653 Finally, options may be specified after a colon (:). The options allow you
654 to "deny" a user or a group, set the access to "ro" (read-only), or set the
655 access to "rw" (read/write). Setting an auth-rule-specific ro/rw setting
656 overrides the module's "[read only](#)" setting.
658 Be sure to put the rules in the order you want them to be matched, because
659 the checking stops at the first matching user or group, and that is the
660 only auth that is checked. For example:
662 > auth users = joe:deny @guest:deny admin:rw @rsync:ro susan joe sam
664 In the above rule, user joe will be denied access no matter what. Any user
665 that is in the group "guest" is also denied access. The user "admin" gets
666 access in read/write mode, but only if the admin user is not in group
667 "guest" (because the admin user-matching rule would never be reached if the
668 user is in group "guest"). Any other user who is in group "rsync" will get
669 read-only access. Finally, users susan, joe, and sam get the ro/rw setting
670 of the module, but only if the user didn't match an earlier group-matching
673 If you need to specify a user or group name with a space in it, start your
674 list with a comma to indicate that the list should only be split on commas
675 (though leading and trailing whitespace will also be removed, and empty
676 entries are just ignored). For example:
678 > auth users = , joe:deny, @Some Group:deny, admin:rw, @RO Group:ro
680 See the description of the secrets file for how you can have per-user
681 passwords as well as per-group passwords. It also explains how a user can
682 authenticate using their user password or (when applicable) a group
683 password, depending on what rule is being authenticated.
685 See also the section entitled "USING RSYNC-DAEMON FEATURES VIA A REMOTE
686 SHELL CONNECTION" in **rsync**(1) for information on how handle an
687 rsyncd.conf-level username that differs from the remote-shell-level
688 username when using a remote shell to connect to an rsync daemon.
692 This parameter specifies the name of a file that contains the
693 username:password and/or @groupname:password pairs used for authenticating
694 this module. This file is only consulted if the "[auth users](#)" parameter is
695 specified. The file is line-based and contains one name:password pair per
696 line. Any line has a hash (#) as the very first character on the line is
697 considered a comment and is skipped. The passwords can contain any
698 characters but be warned that many operating systems limit the length of
699 passwords that can be typed at the client end, so you may find that
700 passwords longer than 8 characters don't work.
702 The use of group-specific lines are only relevant when the module is being
703 authorized using a matching "@groupname" rule. When that happens, the user
704 can be authorized via either their "username:password" line or the
705 "@groupname:password" line for the group that triggered the authentication.
707 It is up to you what kind of password entries you want to include, either
708 users, groups, or both. The use of group rules in "[auth users](#)" does not
709 require that you specify a group password if you do not want to use shared
712 There is no default for the "secrets file" parameter, you must choose a
713 name (such as `/etc/rsyncd.secrets`). The file must normally not be
714 readable by "other"; see "[strict modes](#)". If the file is not found or is
715 rejected, no logins for an "[auth users](#)" module will be possible.
719 This parameter determines whether or not the permissions on the secrets
720 file will be checked. If "strict modes" is true, then the secrets file
721 must not be readable by any user ID other than the one that the rsync
722 daemon is running under. If "strict modes" is false, the check is not
723 performed. The default is true. This parameter was added to accommodate
724 rsync running on the Windows operating system.
728 This parameter allows you to specify a list of comma- and/or
729 whitespace-separated patterns that are matched against a connecting
730 client's hostname and IP address. If none of the patterns match, then the
731 connection is rejected.
733 Each pattern can be in one of six forms:
735 - a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address of
736 the form a:b:c::d:e:f. In this case the incoming machine's IP address
738 - an address/mask in the form ipaddr/n where ipaddr is the IP address and n
739 is the number of one bits in the netmask. All IP addresses which match
740 the masked IP address will be allowed in.
741 - an address/mask in the form ipaddr/maskaddr where ipaddr is the IP
742 address and maskaddr is the netmask in dotted decimal notation for IPv4,
743 or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP
744 addresses which match the masked IP address will be allowed in.
745 - a hostname pattern using wildcards. If the hostname of the connecting IP
746 (as determined by a reverse lookup) matches the wildcarded name (using
747 the same rules as normal Unix filename matching), the client is allowed
748 in. This only works if "[reverse lookup](#)" is enabled (the default).
749 - a hostname. A plain hostname is matched against the reverse DNS of the
750 connecting IP (if "[reverse lookup](#)" is enabled), and/or the IP of the
751 given hostname is matched against the connecting IP (if "[forward lookup](#)"
752 is enabled, as it is by default). Any match will be allowed in.
753 - an '@' followed by a netgroup name, which will match if the reverse DNS
754 of the connecting IP is in the specified netgroup.
756 Note IPv6 link-local addresses can have a scope in the address
761 > fe80::%link1/ffff:ffff:ffff:ffff::
763 You can also combine "hosts allow" with "[hosts deny](#)" as a way to add
764 exceptions to your deny list. When both parameters are specified, the
765 "hosts allow" parameter is checked first and a match results in the client
766 being able to connect. A non-allowed host is then matched against the
767 "[hosts deny](#)" list to see if it should be rejected. A host that does not
768 match either list is allowed to connect.
770 The default is no "hosts allow" parameter, which means all hosts can
775 This parameter allows you to specify a list of comma- and/or
776 whitespace-separated patterns that are matched against a connecting clients
777 hostname and IP address. If the pattern matches then the connection is
778 rejected. See the "[hosts allow](#)" parameter for more information.
780 The default is no "hosts deny" parameter, which means all hosts can
785 Controls whether the daemon performs a reverse lookup on the client's IP
786 address to determine its hostname, which is used for "[hosts allow](#)" &
787 "[hosts deny](#)" checks and the "%h" log escape. This is enabled by default,
788 but you may wish to disable it to save time if you know the lookup will not
789 return a useful result, in which case the daemon will use the name
790 "UNDETERMINED" instead.
792 If this parameter is enabled globally (even by default), rsync performs the
793 lookup as soon as a client connects, so disabling it for a module will not
794 avoid the lookup. Thus, you probably want to disable it globally and then
795 enable it for modules that need the information.
799 Controls whether the daemon performs a forward lookup on any hostname
800 specified in an hosts allow/deny setting. By default this is enabled,
801 allowing the use of an explicit hostname that would not be returned by
802 reverse DNS of the connecting IP.
806 This parameter tells rsyncd to ignore I/O errors on the daemon when
807 deciding whether to run the delete phase of the transfer. Normally rsync
808 skips the `--delete` step if any I/O errors have occurred in order to
809 prevent disastrous deletion due to a temporary resource shortage or other
810 I/O error. In some cases this test is counter productive so you can use
811 this parameter to turn off this behavior.
813 0. `ignore nonreadable`
815 This tells the rsync daemon to completely ignore files that are not
816 readable by the user. This is useful for public archives that may have some
817 non-readable files among the directories, and the sysadmin doesn't want
818 those files to be seen at all.
820 0. `transfer logging`
822 This parameter enables per-file logging of downloads and uploads in a
823 format somewhat similar to that used by ftp daemons. The daemon always
824 logs the transfer at the end, so if a transfer is aborted, no mention will
825 be made in the log file.
827 If you want to customize the log lines, see the "[log format](#)" parameter.
831 This parameter allows you to specify the format used for logging file
832 transfers when transfer logging is enabled. The format is a text string
833 containing embedded single-character escape sequences prefixed with a
834 percent (%) character. An optional numeric field width may also be
835 specified between the percent and the escape letter (e.g.
836 "`%-50n %8l %07p`"). In addition, one or more apostrophes may be specified
837 prior to a numerical escape to indicate that the numerical value should be
838 made more human-readable. The 3 supported levels are the same as for the
839 `--human-readable` command-line option, though the default is for
840 human-readability to be off. Each added apostrophe increases the level
841 (e.g. "`%''l %'b %f`").
843 The default log format is "`%o %h [%a] %m (%u) %f %l`", and a "`%t [%p] `"
844 is always prefixed when using the "[log file](#)" parameter. (A perl script
845 that will summarize this default log format is included in the rsync source
846 code distribution in the "support" subdirectory: rsyncstats.)
848 The single-character escapes that are understood are as follows:
850 - %a the remote IP address (only available for a daemon)
851 - %b the number of bytes actually transferred
852 - %B the permission bits of the file (e.g. rwxrwxrwt)
853 - %c the total size of the block checksums received for the basis file
855 - %C the full-file checksum if it is known for the file. For older rsync
856 protocols/versions, the checksum was salted, and is thus not a useful
857 value (and is not displayed when that is the case). For the checksum to
858 output for a file, either the `--checksum` option must be in-effect or
859 the file must have been transferred without a salted checksum being used.
860 See the `--checksum-choice` option for a way to choose the algorithm.
861 - %f the filename (long form on sender; no trailing "/")
862 - %G the gid of the file (decimal) or "DEFAULT"
863 - %h the remote host name (only available for a daemon)
864 - %i an itemized list of what is being updated
865 - %l the length of the file in bytes
866 - %L the string "` -> SYMLINK`", "` => HARDLINK`", or "" (where `SYMLINK`
867 or `HARDLINK` is a filename)
869 - %M the last-modified time of the file
870 - %n the filename (short form; trailing "/" on dir)
871 - %o the operation, which is "send", "recv", or "del." (the latter includes
873 - %p the process ID of this rsync session
875 - %t the current date time
876 - %u the authenticated username or an empty string
877 - %U the uid of the file (decimal)
879 For a list of what the characters mean that are output by "%i", see the
880 `--itemize-changes` option in the rsync manpage.
882 Note that some of the logged output changes when talking with older rsync
883 versions. For instance, deleted files were only output as verbose messages
884 prior to rsync 2.6.4.
888 This parameter allows you to override the clients choice for I/O timeout
889 for this module. Using this parameter you can ensure that rsync won't wait
890 on a dead client forever. The timeout is specified in seconds. A value of
891 zero means no timeout and is the default. A good choice for anonymous rsync
892 daemons may be 600 (giving a 10 minute timeout).
896 This parameter allows you to specify a space-separated list of rsync
897 command-line options that will be refused by your rsync daemon. You may
898 specify the full option name, its one-letter abbreviation, or a wild-card
899 string that matches multiple options. Beginning in 3.2.0, you can also
900 negate a match term by starting it with a "!".
902 When an option is refused, the daemon prints an error message and exits.
904 For example, this would refuse `--checksum` (`-c`) and all the various
907 > refuse options = c delete
909 The reason the above refuses all delete options is that the options imply
910 `--delete`, and implied options are refused just like explicit options.
912 The use of a negated match allows you to fine-tune your refusals after a
913 wild-card, such as this:
915 > refuse options = delete-* !delete-during
917 Negated matching can also turn your list of refused options into a list of
918 accepted options. To do this, begin the list with a "`*`" (to refuse all
919 options) and then specify one or more negated matches to accept. For
922 > refuse options = * !a !v !compress*
924 Don't worry that the "`*`" will refuse certain vital options such as
925 `--dry-run`, `--server`, `--no-iconv`, `--seclude-args`, etc. These
926 important options are not matched by wild-card, so they must be overridden
927 by their exact name. For instance, if you're forcing iconv transfers you
928 could use something like this:
930 > refuse options = * no-iconv !a !v
932 As an additional aid (beginning in 3.2.0), refusing (or "`!refusing`") the
933 "a" or "archive" option also affects all the options that the `--archive`
934 option implies (`-rdlptgoD`), but only if the option is matched explicitly
935 (not using a wildcard). If you want to do something tricky, you can use
936 "`archive*`" to avoid this side-effect, but keep in mind that no normal
937 rsync client ever sends the actual archive option to the server.
939 As an additional safety feature, the refusal of "delete" also refuses
940 `remove-source-files` when the daemon is the sender; if you want the latter
941 without the former, instead refuse "`delete-*`" as that refuses all the
942 delete modes without affecting `--remove-source-files`. (Keep in mind that
943 the client's `--delete` option typically results in `--delete-during`.)
945 When un-refusing delete options, you should either specify "`!delete*`" (to
946 accept all delete options) or specify a limited set that includes "delete",
949 > refuse options = * !a !delete !delete-during
951 ... whereas this accepts any delete option except `--delete-after`:
953 > refuse options = * !a !delete* delete-after
955 A note on refusing "compress": it may be better to set the "[dont compress](#)"
956 daemon parameter to "`*`" and ensure that `RSYNC_COMPRESS_LIST=zlib` is set
957 in the environment of the daemon in order to disable compression silently
958 instead of returning an error that forces the client to remove the `-z`
961 If you are un-refusing the compress option, you may want to match
962 "`!compress*`" if you also want to allow the `--compress-level` option.
964 Note that the "copy-devices" & "write-devices" options are refused by
965 default, but they can be explicitly accepted with "`!copy-devices`" and/or
966 "`!write-devices`". The options "log-file" and "log-file-format" are
967 forcibly refused and cannot be accepted.
969 Here are all the options that are not matched by wild-cards:
971 - `--server`: Required for rsync to even work.
972 - `--rsh`, `-e`: Required to convey compatibility flags to the server.
973 - `--out-format`: This is required to convey output behavior to a remote
974 receiver. While rsync passes the older alias `--log-format` for
975 compatibility reasons, this options should not be confused with
977 - `--sender`: Use "[write only](#)" parameter instead of refusing this.
978 - `--dry-run`, `-n`: Who would want to disable this?
979 - `--seclude-args`, `-s`: Is the oldest arg-protection method.
980 - `--from0`, `-0`: Makes it easier to accept/refuse `--files-from` without
981 affecting this helpful modifier.
982 - `--iconv`: This is auto-disabled based on "[charset](#)" parameter.
983 - `--no-iconv`: Most transfers use this option.
984 - `--checksum-seed`: Is a fairly rare, safe option.
985 - `--write-devices`: Is non-wild but also auto-disabled.
989 **NOTE:** This parameter currently has no effect except in one instance: if
990 it is set to "`*`" then it minimizes or disables compression for all files
991 (for those that don't want to refuse the `--compress` option completely).
993 This parameter allows you to select filenames based on wildcard patterns
994 that should not be compressed when pulling files from the daemon (no
995 analogous parameter exists to govern the pushing of files to a daemon).
996 Compression can be expensive in terms of CPU usage, so it is usually good
997 to not try to compress files that won't compress well, such as already
1000 The "dont compress" parameter takes a space-separated list of
1001 case-insensitive wildcard patterns. Any source filename matching one of the
1002 patterns will be compressed as little as possible during the transfer. If
1003 the compression algorithm has an "off" level, then no compression occurs
1004 for those files. If an algorithms has the ability to change the level in
1005 mid-stream, it will be minimized to reduce the CPU usage as much as
1008 See the `--skip-compress` parameter in the **rsync**(1) manpage for the
1009 list of file suffixes that are skipped by default if this parameter is not
1012 0. `early exec`, `pre-xfer exec`, `post-xfer exec`
1014 You may specify a command to be run in the early stages of the connection,
1015 or right before and/or after the transfer. If the `early exec` or
1016 `pre-xfer exec` command returns an error code, the transfer is aborted
1017 before it begins. Any output from the `pre-xfer exec` command on stdout
1018 (up to several KB) will be displayed to the user when aborting, but is
1019 _not_ displayed if the script returns success. The other programs cannot
1020 send any text to the user. All output except for the `pre-xfer exec`
1021 stdout goes to the corresponding daemon's stdout/stderr, which is typically
1022 discarded. See the `--no-detatch` option for a way to see the daemon's
1023 output, which can assist with debugging.
1025 Note that the `early exec` command runs before any part of the transfer
1026 request is known except for the module name. This helper script can be
1027 used to setup a disk mount or decrypt some data into a module dir, but you
1028 may need to use `lock file` and `max connections` to avoid concurrency
1029 issues. If the client rsync specified the `--early-input=FILE` option, it
1030 can send up to about 5K of data to the stdin of the early script. The
1031 stdin will otherwise be empty.
1033 Note that the `post-xfer exec` command is still run even if one of the
1034 other scripts returns an error code. The `pre-xfer exec` command will _not_
1035 be run, however, if the `early exec` command fails.
1037 The following environment variables will be set, though some are specific
1038 to the pre-xfer or the post-xfer environment:
1040 - `RSYNC_MODULE_NAME`: The name of the module being accessed.
1041 - `RSYNC_MODULE_PATH`: The path configured for the module.
1042 - `RSYNC_HOST_ADDR`: The accessing host's IP address.
1043 - `RSYNC_HOST_NAME`: The accessing host's name.
1044 - `RSYNC_USER_NAME`: The accessing user's name (empty if no user).
1045 - `RSYNC_PID`: A unique number for this transfer.
1046 - `RSYNC_REQUEST`: (pre-xfer only) The module/path info specified by the
1047 user. Note that the user can specify multiple source files, so the
1048 request can be something like "mod/path1 mod/path2", etc.
1049 - `RSYNC_ARG#`: (pre-xfer only) The pre-request arguments are set in these
1050 numbered values. RSYNC_ARG0 is always "rsyncd", followed by the options
1051 that were used in RSYNC_ARG1, and so on. There will be a value of "."
1052 indicating that the options are done and the path args are beginning --
1053 these contain similar information to RSYNC_REQUEST, but with values
1054 separated and the module name stripped off.
1055 - `RSYNC_EXIT_STATUS`: (post-xfer only) the server side's exit value. This
1056 will be 0 for a successful run, a positive value for an error that the
1057 server generated, or a -1 if rsync failed to exit properly. Note that an
1058 error that occurs on the client side does not currently get sent to the
1059 server side, so this is not the final exit status for the whole transfer.
1060 - `RSYNC_RAW_STATUS`: (post-xfer only) the raw exit value from
1063 Even though the commands can be associated with a particular module, they
1064 are run using the permissions of the user that started the daemon (not the
1065 module's uid/gid setting) without any chroot restrictions.
1067 These settings honor 2 environment variables: use RSYNC_SHELL to set a
1068 shell to use when running the command (which otherwise uses your
1069 **system()** call's default shell), and use RSYNC_NO_XFER_EXEC to disable
1070 both options completely.
1072 ## CONFIG DIRECTIVES
1074 There are currently two config directives available that allow a config file to
1075 incorporate the contents of other files: `&include` and `&merge`. Both allow
1076 a reference to either a file or a directory. They differ in how segregated the
1077 file's contents are considered to be.
1079 The `&include` directive treats each file as more distinct, with each one
1080 inheriting the defaults of the parent file, starting the parameter parsing as
1081 globals/defaults, and leaving the defaults unchanged for the parsing of the
1082 rest of the parent file.
1084 The `&merge` directive, on the other hand, treats the file's contents as if it
1085 were simply inserted in place of the directive, and thus it can set parameters
1086 in a module started in another file, can affect the defaults for other files,
1089 When an `&include` or `&merge` directive refers to a directory, it will read in
1090 all the `*.conf` or `*.inc` files (respectively) that are contained inside that
1091 directory (without any recursive scanning), with the files sorted into alpha
1092 order. So, if you have a directory named "rsyncd.d" with the files "foo.conf",
1093 "bar.conf", and "baz.conf" inside it, this directive:
1095 > &include /path/rsyncd.d
1097 would be the same as this set of directives:
1099 > &include /path/rsyncd.d/bar.conf
1100 > &include /path/rsyncd.d/baz.conf
1101 > &include /path/rsyncd.d/foo.conf
1103 except that it adjusts as files are added and removed from the directory.
1105 The advantage of the `&include` directive is that you can define one or more
1106 modules in a separate file without worrying about unintended side-effects
1107 between the self-contained module files.
1109 The advantage of the `&merge` directive is that you can load config snippets
1110 that can be included into multiple module definitions, and you can also set
1111 global values that will affect connections (such as `motd file`), or globals
1112 that will affect other include files.
1114 For example, this is a useful /etc/rsyncd.conf file:
1117 > log file = /var/log/rsync.log
1118 > pid file = /var/lock/rsync.lock
1120 > &merge /etc/rsyncd.d
1121 > &include /etc/rsyncd.d
1123 This would merge any `/etc/rsyncd.d/*.inc` files (for global values that should
1124 stay in effect), and then include any `/etc/rsyncd.d/*.conf` files (defining
1125 modules without any global-value cross-talk).
1127 ## AUTHENTICATION STRENGTH
1129 The authentication protocol used in rsync is a 128 bit MD4 based challenge
1130 response system. This is fairly weak protection, though (with at least one
1131 brute-force hash-finding algorithm publicly available), so if you want really
1132 top-quality security, then I recommend that you run rsync over ssh. (Yes, a
1133 future version of rsync will switch over to a stronger hashing method.)
1135 Also note that the rsync daemon protocol does not currently provide any
1136 encryption of the data that is transferred over the connection. Only
1137 authentication is provided. Use ssh as the transport if you want encryption.
1139 You can also make use of SSL/TLS encryption if you put rsync behind an
1142 ## SSL/TLS Daemon Setup
1144 When setting up an rsync daemon for access via SSL/TLS, you will need to
1145 configure a TCP proxy (such as haproxy or nginx) as the front-end that handles
1148 - You should limit the access to the backend-rsyncd port to only allow the
1149 proxy to connect. If it is on the same host as the proxy, then configuring
1150 it to only listen on localhost is a good idea.
1151 - You should consider turning on the `proxy protocol` rsync-daemon parameter if
1152 your proxy supports sending that information. The examples below assume that
1155 An example haproxy setup is as follows:
1158 > frontend fe_rsync-ssl
1159 > bind :::874 ssl crt /etc/letsencrypt/example.com/combined.pem
1161 > use_backend be_rsync
1165 > server local-rsync 127.0.0.1:873 check send-proxy
1168 An example nginx proxy setup is as follows:
1174 > listen [::]:874 ssl;
1176 > ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;
1177 > ssl_certificate_key /etc/letsencrypt/example.com/privkey.pem;
1179 > proxy_pass localhost:873;
1180 > proxy_protocol on; # Requires rsyncd.conf "proxy protocol = true"
1182 > proxy_connect_timeout 5s;
1187 ## DAEMON CONFIG EXAMPLES
1189 A simple rsyncd.conf file that allow anonymous rsync to a ftp area at
1190 `/home/ftp` would be:
1195 > comment = ftp export area
1198 A more sophisticated example would be:
1204 > max connections = 4
1205 > syslog facility = local5
1206 > pid file = /var/run/rsyncd.pid
1209 > path = /var/ftp/./pub
1210 > comment = whole ftp area (approx 6.1 GB)
1213 > path = /var/ftp/./pub/samba
1214 > comment = Samba ftp area (approx 300 MB)
1217 > path = /var/ftp/./pub/rsync
1218 > comment = rsync ftp area (approx 6 MB)
1221 > path = /public_html/samba
1222 > comment = Samba WWW pages (approx 240 MB)
1226 > comment = CVS repository (requires authentication)
1227 > auth users = tridge, susan
1228 > secrets file = /etc/rsyncd.secrets
1231 The /etc/rsyncd.secrets file would look something like this:
1238 /etc/rsyncd.conf or rsyncd.conf
1242 [**rsync**(1)](rsync.1), [**rsync-ssl**(1)](rsync-ssl.1)
1246 Please report bugs! The rsync bug tracking system is online at
1247 <https://rsync.samba.org/>.
1251 This manpage is current for version @VERSION@ of rsync.
1255 Rsync is distributed under the GNU General Public License. See the file
1256 [COPYING](COPYING) for details.
1258 An rsync web site is available at <https://rsync.samba.org/> and its github
1259 project is <https://github.com/WayneD/rsync>.
1263 Thanks to Warren Stanley for his original idea and patch for the rsync daemon.
1264 Thanks to Karsten Thygesen for his many suggestions and documentation!
1268 Rsync was originally written by Andrew Tridgell and Paul Mackerras. Many
1269 people have later contributed to it. It is currently maintained by Wayne
1272 Mailing lists for support and development are available at
1273 <https://lists.samba.org/>.