Debian Codegraph @

rsyncd.conf.5

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