Section: (5)
Updated: 8 May 2009
Index Return to Main Contents


rsyncd.conf --- configuration file for rsync in daemon mode  










The file is line-based --- that is, each newline-terminated line represents either a comment, a module name or a parameter.



Any line ending in a \ is lqcontinuedrq on the next line in the customary UNIX fashion.






You can launch it either via inetd, as a stand-alone daemon, or from an rsync client via a remote shell. If run as a stand-alone daemon then just run the command lqrsync --daemonrq from a suitable startup script.


  rsync           873/tcp



Replace lq/usr/bin/rsyncrq with the path to where you have rsync installed on your system. You will then need to send inetd a HUP signal to tell it to reread its config file.






motd file
This parameter allows you to specify a lqmessage of the dayrq to display to clients on each connect. This usually contains site information and any legal notices. The default is no motd file.
pid file
socket options



use chroot
As an additional safety feature, you can specify a dot-dir in the module's lqpathrq to indicate the point where the chroot should occur. This allows rsync to run in a chroot with a non-"/rq path for the top of the transfer hierarchy. Doing this guards against unintended library loading (since those absolute paths will not be inside the transfer hierarchy unless you have used an unwise pathname), and lets you setup libraries for the chroot that are outside of the transfer. For example, specifying lq/var/rsync/./module1rq will chroot to the lq/var/rsyncrq directory and set the inside-chroot path to lq/module1rq. If you had omitted the dot-dir, the chroot would have used the whole path, and the inside-chroot path would have been lq/rq.
When lquse chrootrq is false or the inside-chroot path is not lq/rq, rsync will: (1) munge symlinks by default for security reasons (see lqmunge symlinksrq for a way to turn this off, but only if you trust your users), (2) substitute leading slashes in absolute paths with the module's path (so that options such as --backup-dir, --compare-dest, etc. interpret an absolute path as rooted in the module's lqpathrq dir), and (3) trim lq..rq path elements from args if rsync believes they would escape the module hierarchy. The default for lquse chrootrq is true, and is the safer choice (especially if the module is not read-only).
If you copy the necessary resources into the module's chroot area, you should protect them through your OS's normal user/group or ACL settings (to prevent the rsync module's user from being able to change them), and then hide them from the user's view via lqexcluderq (see how in the discussion of that parameter). At that point it will be safe to enable the mapping of users and groups by name using the lqnumeric idsrq daemon parameter (see below).
numeric ids
A chroot-enabled module should not have this parameter enabled unless you've taken steps to ensure that the module has the necessary resources it needs to translate names, and that it is not possible for a user to change those resources.
munge symlinks
This parameter tells rsync to modify all incoming symlinks in a way that makes them unusable but recoverable (see below). This should help protect your files from user trickery when your daemon module is writable. The default is disabled when lquse chrootrq is on and the inside-chroot path is lq/rq, otherwise it is enabled.
If you disable this parameter on a daemon that is not read-only, there are tricks that a user can play with uploaded symlinks to access daemon-excluded items (if your module has any), and, if lquse chrootrq is off, rsync can even be tricked into showing or changing data that is outside the module's path (as access-permissions allow).
The way rsync disables the use of symlinks is to prefix each one with the string lq/rsyncd-munged/rq. This prevents the links from being used as long as that directory does not exist. When this parameter is enabled, rsync will refuse to run if that path is a directory or a symlink to a directory. When using the lqmunge symlinksrq parameter in a chroot area that has an inside-chroot path of lq/rq, you should add lq/rsyncd-munged/rq to the exclude setting for the module so that a user can't try to create it.
Note: rsync makes no attempt to verify that any pre-existing symlinks in the module's hierarchy are as safe as you want them to be (unless, of course, it just copied in the whole hierarchy). If you setup an rsync daemon on a new area or locally add symlinks, you can manually protect your symlinks from being abused by prefixing lq/rsyncd-munged/rq to the start of every symlink's value. There is a perl script in the support directory of the source code named lqmunge-symlinksrq that can be used to add or remove this prefix from your symlinks.
When this parameter is disabled on a writable module and lquse chrootrq is off (or the inside-chroot path is not lq/rq), incoming symlinks will be modified to drop a leading slash and to remove lq..rq path elements that rsync believes will allow a symlink to escape the module's hierarchy. There are tricky ways to work around this, though, so you had better trust your users if you choose this combination of parameters.
This specifies the name of the character set in which the module's filenames are stored. If the client uses an --iconv option, the daemon will use the value of the lqcharsetrq parameter regardless of the character set the client actually passed. This allows the daemon to support charset conversion in a chroot module without extra files in the chroot area, and also ensures that name-translation is done in a consistent manner. If the lqcharsetrq parameter is not set, the --iconv option is refused, just as if lqiconvrq had been specified via lqrefuse optionsrq.
If you wish to force users to always use --iconv for a particular module, add lqno-iconvrq to the lqrefuse optionsrq parameter. Keep in mind that this will restrict access to your module to very new rsync clients.
max connections
log file
syslog facility
max verbosity
lock file
This parameter specifies the file to use to support the lqmax connectionsrq parameter. The rsync daemon uses record locking on this file to ensure that the max connections limit is not exceeded for the modules sharing the lock file. The default is /var/run/rsyncd.lock.
read only
This parameter determines whether clients will be able to upload files or not. If lqread onlyrq is true then any attempted uploads will fail. If lqread onlyrq is false then uploads will be possible if file permissions on the daemon side allow them. The default is for all modules to be read only.
write only
This parameter determines whether clients will be able to download files or not. If lqwrite onlyrq is true then any attempted downloads will fail. If lqwrite onlyrq is false then downloads will be possible if file permissions on the daemon side allow them. The default is for this parameter to be disabled.
This parameter specifies the user name or user ID that file transfers to and from that module should take place as when the daemon was run as root. In combination with the lqgidrq parameter this determines what file permissions are available. The default is uid -2, which is normally the user lqnobodyrq.
This parameter specifies the group name or group ID that file transfers to and from that module should take place as when the daemon was run as root. This complements the lquidrq parameter. The default is gid -2, which is normally the group lqnobodyrq.
fake super
Setting lqfake super = yesrq for a module causes the daemon side to behave as if the --fake-user command-line option had been specified. This allows the full attributes of a file to be stored without having to have the daemon actually running as root.
The daemon filter chain is built from the lqfilterrq, lqinclude fromrq, lqincluderq, lqexclude fromrq, and lqexcluderq parameters, in that order of priority. Anchored patterns are anchored at the root of the module. To prevent access to an entire subtree, for example, lq/secretrq, you must exclude everything in the subtree; the easiest way to do this is with a triple-star pattern like lq/secret/***rq.
The lqfilterrq parameter takes a space-separated list of daemon filter rules, though it is smart enough to know not to split a token at an internal space in a rule (e.g. lq- /foo --- /barrq is parsed as two rules). You may specify one or more merge-file rules using the normal syntax. Only one lqfilterrq parameter can apply to a given module in the config file, so put all the rules you want in a single parameter. Note that per-directory merge-file rules do not provide as much protection as global rules, but they can be used to make --delete work better during a client download operation if the per-dir merge files are included in the transfer and the client requests that they be used.
This parameter takes a space-separated list of daemon exclude patterns. As with the client --exclude option, patterns can be qualified with lq- rq or lq+ rq to explicitly indicate exclude/include. Only one lqexcluderq parameter can apply to a given module. See the lqfilterrq parameter for a description of how excluded files affect the daemon.
Use an lqincluderq to override the effects of the lqexcluderq parameter. Only one lqincluderq parameter can apply to a given module. See the lqfilterrq parameter for a description of how excluded files affect the daemon.
exclude from
This parameter specifies the name of a file on the daemon that contains daemon exclude patterns, one per line. Only one lqexclude fromrq parameter can apply to a given module; if you have multiple exclude-from files, you can specify them as a merge file in the lqfilterrq parameter. See the lqfilterrq parameter for a description of how excluded files affect the daemon.
include from
Analogue of lqexclude fromrq for a file of daemon include patterns. Only one lqinclude fromrq parameter can apply to a given module. See the lqfilterrq parameter for a description of how excluded files affect the daemon.
incoming chmod
outgoing chmod
auth users
This parameter specifies a comma and space-separated list of usernames that will be allowed to connect to this module. The usernames do not need to exist on the local system. The usernames may also contain shell wildcard characters. If lqauth usersrq is set then the client will be challenged to supply a username and password to connect to the module. A challenge response authentication protocol is used for this exchange. The plain text usernames and passwords are stored in the file specified by the lqsecrets filerq parameter. The default is for all users to be able to connect without a password (this is called lqanonymous rsyncrq).
See also the lqCONNECTING TO AN RSYNC DAEMON OVER A REMOTE SHELL PROGRAMrq section in rsync(1) for information on how handle an rsyncd.conf-level username that differs from the remote-shell-level username when using a remote shell to connect to an rsync daemon.
secrets file
There is no default for the lqsecrets filerq parameter, you must choose a name (such as /etc/rsyncd.secrets). The file must normally not be readable by lqotherrq; see lqstrict modesrq.
strict modes
This parameter determines whether or not the permissions on the secrets file will be checked. If lqstrict modesrq is true, then the secrets file must not be readable by any user ID other than the one that the rsync daemon is running under. If lqstrict modesrq is false, the check is not performed. The default is true. This parameter was added to accommodate rsync running on the Windows operating system.
hosts allow
Each pattern can be in one of five forms:


You can also combine lqhosts allowrq with a separate lqhosts denyrq parameter. If both parameters are specified then the lqhosts allowrq parameter is checked first and a match results in the client being able to connect. The lqhosts denyrq parameter is then checked and a match means that the host is rejected. If the host does not match either the lqhosts allowrq or the lqhosts denyrq patterns then it is allowed to connect.
The default is no lqhosts allowrq parameter, which means all hosts can connect.
hosts deny
This parameter allows you to specify a list of patterns that are matched against a connecting clients hostname and IP address. If the pattern matches then the connection is rejected. See the lqhosts allowrq parameter for more information.
The default is no lqhosts denyrq parameter, which means all hosts can connect.
ignore errors
ignore nonreadable
transfer logging
If you want to customize the log lines, see the lqlog formatrq parameter.
log format
The default log format is lq%o %h [%a] %m (%u) %f %lrq, and a lq%t [%p] rq is always prefixed when using the lqlog filerq parameter. (A perl script that will summarize this default log format is included in the rsync source code distribution in the lqsupportrq subdirectory: rsyncstats.)
The single-character escapes that are understood are as follows:
%a the remote IP address
%b the number of bytes actually transferred
%f the filename (long form on sender; no trailing lq/rq)
%G the gid of the file (decimal) or lqDEFAULTrq
%h the remote host name
%i an itemized list of what is being updated
%l the length of the file in bytes
%L the string lq -> SYMLINKrq, lq => HARDLINKrq, or lqrq (where SYMLINK or HARDLINK is a filename)
%m the module name
%M the last-modified time of the file
%n the filename (short form; trailing lq/rq on dir)
%o the operation, which is lqsendrq, lqrecvrq, or lqdel.rq (the latter includes the trailing period)
%p the process ID of this rsync session
%P the module path
%t the current date time
%u the authenticated username or an empty string
%U the uid of the file (decimal)

For a list of what the characters mean that are output by lq%irq, see the --itemize-changes option in the rsync manpage.
refuse options
refuse options = c delete

The reason the above refuses all delete options is that the options imply --delete, and implied options are refused just like explicit options. As an additional safety feature, the refusal of lqdeleterq also refuses remove-source-files when the daemon is the sender; if you want the latter without the former, instead refuse lqdelete-*rq --- that refuses all the delete modes without affecting --remove-source-files.
When an option is refused, the daemon prints an error message and exits. To prevent all compression when serving files, you can use lqdont compress = *rq (see below) instead of lqrefuse options = compressrq to avoid returning an error to a client that requests compression.
dont compress
See the --skip-compress parameter in the rsync(1) manpage for the list of file suffixes that are not compressed by default. Specifying a value for the lqdont compressrq parameter changes the default when the daemon is the sender.
pre-xfer exec, post-xfer exec
RSYNC_MODULE_NAME: The name of the module being accessed.
RSYNC_MODULE_PATH: The path configured for the module.
RSYNC_HOST_ADDR: The accessing host's IP address.
RSYNC_HOST_NAME: The accessing host's name.
RSYNC_PID: A unique number for this transfer.
RSYNC_REQUEST: (pre-xfer only) The module/path info specified by the user (note that the user can specify multiple source files, so the request can be something like lqmod/path1 mod/path2rq, etc.).
RSYNC_ARG#: (pre-xfer only) The pre-request arguments are set in these numbered values. RSYNC_ARG0 is always lqrsyncdrq, and the last value contains a single period.









        path = /home/ftp
        comment = ftp export area

A more sophisticated example would be:

uid = nobody
gid = nobody
use chroot = yes
max connections = 4
syslog facility = local5
pid file = /var/run/

        path = /var/ftp/./pub
        comment = whole ftp area (approx 6.1 GB)

        path = /var/ftp/./pub/samba
        comment = Samba ftp area (approx 300 MB)

        path = /var/ftp/./pub/rsync
        comment = rsync ftp area (approx 6 MB)

        path = /public_html/samba
        comment = Samba WWW pages (approx 240 MB)

        path = /data/cvs
        comment = CVS repository (requires authentication)
        auth users = tridge, susan
        secrets file = /etc/rsyncd.secrets

The /etc/rsyncd.secrets file would look something like this:




/etc/rsyncd.conf or rsyncd.conf








Please report bugs! The rsync bug tracking system is online at



This man page is current for version 3.0.6 of rsync.




The primary ftp site for rsync is

A WEB site is available at









Mailing lists for support and development are available at




This document was created by man2html, using the manual pages.