rsyncd.conf.5 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. .TH "rsyncd.conf" "5" "6 Sep 2008" "" ""
  2. .SH "NAME"
  3. rsyncd.conf \(em configuration file for rsync in daemon mode
  4. .SH "SYNOPSIS"
  5. .PP
  6. rsyncd.conf
  7. .PP
  8. .SH "DESCRIPTION"
  9. .PP
  10. The rsyncd.conf file is the runtime configuration file for rsync when
  11. run as an rsync daemon.
  12. .PP
  13. The rsyncd.conf file controls authentication, access, logging and
  14. available modules.
  15. .PP
  16. .SH "FILE FORMAT"
  17. .PP
  18. The file consists of modules and parameters. A module begins with the
  19. name of the module in square brackets and continues until the next
  20. module begins. Modules contain parameters of the form \(lqname = value\(rq.
  21. .PP
  22. The file is line-based \(em that is, each newline-terminated line represents
  23. either a comment, a module name or a parameter.
  24. .PP
  25. Only the first equals sign in a parameter is significant. Whitespace before
  26. or after the first equals sign is discarded. Leading, trailing and internal
  27. whitespace in module and parameter names is irrelevant. Leading and
  28. trailing whitespace in a parameter value is discarded. Internal whitespace
  29. within a parameter value is retained verbatim.
  30. .PP
  31. Any line beginning with a hash (#) is ignored, as are lines containing
  32. only whitespace.
  33. .PP
  34. Any line ending in a \e is \(lqcontinued\(rq on the next line in the
  35. customary UNIX fashion.
  36. .PP
  37. The values following the equals sign in parameters are all either a string
  38. (no quotes needed) or a boolean, which may be given as yes/no, 0/1 or
  39. true/false. Case is not significant in boolean values, but is preserved
  40. in string values.
  41. .PP
  42. .SH "LAUNCHING THE RSYNC DAEMON"
  43. .PP
  44. The rsync daemon is launched by specifying the \fB\-\-daemon\fP option to
  45. rsync.
  46. .PP
  47. The daemon must run with root privileges if you wish to use chroot, to
  48. bind to a port numbered under 1024 (as is the default 873), or to set
  49. file ownership. Otherwise, it must just have permission to read and
  50. write the appropriate data, log, and lock files.
  51. .PP
  52. You can launch it either via inetd, as a stand-alone daemon, or from
  53. an rsync client via a remote shell. If run as a stand-alone daemon then
  54. just run the command \(lq\fBrsync \-\-daemon\fP\(rq from a suitable startup script.
  55. .PP
  56. When run via inetd you should add a line like this to /etc/services:
  57. .PP
  58. .nf
  59. rsync 873/tcp
  60. .fi
  61. .PP
  62. and a single line something like this to /etc/inetd.conf:
  63. .PP
  64. .nf
  65. rsync stream tcp nowait root /usr/bin/rsync rsyncd \-\-daemon
  66. .fi
  67. .PP
  68. Replace \(lq/usr/bin/rsync\(rq with the path to where you have rsync installed on
  69. your system. You will then need to send inetd a HUP signal to tell it to
  70. reread its config file.
  71. .PP
  72. Note that you should \fBnot\fP send the rsync daemon a HUP signal to force
  73. it to reread the \f(CWrsyncd.conf\fP file. The file is re-read on each client
  74. connection.
  75. .PP
  76. .SH "GLOBAL PARAMETERS"
  77. .PP
  78. The first parameters in the file (before a [module] header) are the
  79. global parameters.
  80. .PP
  81. You may also include any module parameters in the global part of the
  82. config file in which case the supplied value will override the
  83. default for that parameter.
  84. .PP
  85. .IP "\fBmotd file\fP"
  86. This parameter allows you to specify a
  87. \(lqmessage of the day\(rq to display to clients on each connect. This
  88. usually contains site information and any legal notices. The default
  89. is no motd file.
  90. .IP
  91. .IP "\fBpid file\fP"
  92. This parameter tells the rsync daemon to write
  93. its process ID to that file. If the file already exists, the rsync
  94. daemon will abort rather than overwrite the file.
  95. .IP
  96. .IP "\fBport\fP"
  97. You can override the default port the daemon will listen on
  98. by specifying this value (defaults to 873). This is ignored if the daemon
  99. is being run by inetd, and is superseded by the \fB\-\-port\fP command-line option.
  100. .IP
  101. .IP "\fBaddress\fP"
  102. You can override the default IP address the daemon
  103. will listen on by specifying this value. This is ignored if the daemon is
  104. being run by inetd, and is superseded by the \fB\-\-address\fP command-line option.
  105. .IP
  106. .IP "\fBsocket options\fP"
  107. This parameter can provide endless fun for people
  108. who like to tune their systems to the utmost degree. You can set all
  109. sorts of socket options which may make transfers faster (or
  110. slower!). Read the man page for the
  111. \f(CWsetsockopt()\fP
  112. system call for
  113. details on some of the options you may be able to set. By default no
  114. special socket options are set. These settings can also be specified
  115. via the \fB\-\-sockopts\fP command-line option.
  116. .IP
  117. .SH "MODULE PARAMETERS"
  118. .PP
  119. After the global parameters you should define a number of modules, each
  120. module exports a directory tree as a symbolic name. Modules are
  121. exported by specifying a module name in square brackets [module]
  122. followed by the parameters for that module.
  123. The module name cannot contain a slash or a closing square bracket. If the
  124. name contains whitespace, each internal sequence of whitespace will be
  125. changed into a single space, while leading or trailing whitespace will be
  126. discarded.
  127. .PP
  128. .IP "\fBcomment\fP"
  129. This parameter specifies a description string
  130. that is displayed next to the module name when clients obtain a list
  131. of available modules. The default is no comment.
  132. .IP
  133. .IP "\fBpath\fP"
  134. This parameter specifies the directory in the daemon's
  135. filesystem to make available in this module. You must specify this parameter
  136. for each module in \f(CWrsyncd.conf\fP.
  137. .IP
  138. .IP "\fBuse chroot\fP"
  139. If \(lquse chroot\(rq is true, the rsync daemon will chroot
  140. to the \(lqpath\(rq before starting the file transfer with the client. This has
  141. the advantage of extra protection against possible implementation security
  142. holes, but it has the disadvantages of requiring super-user privileges,
  143. of not being able to follow symbolic links that are either absolute or outside
  144. of the new root path, and of complicating the preservation of users and groups
  145. by name (see below).
  146. .IP
  147. As an additional safety feature, you can specify a dot-dir in the module's
  148. \(lqpath\(rq to indicate the point where the chroot should occur. This allows rsync
  149. to run in a chroot with a non\-"/\(rq path for the top of the transfer hierarchy.
  150. Doing this guards against unintended library loading (since those absolute
  151. paths will not be inside the transfer hierarchy unless you have used an unwise
  152. pathname), and lets you setup libraries for the chroot that are outside of the
  153. transfer. For example, specifying \(lq/var/rsync/./module1\(rq will chroot to the
  154. \(lq/var/rsync\(rq directory and set the inside-chroot path to \(lq/module1\(rq. If you
  155. had omitted the dot-dir, the chroot would have used the whole path, and the
  156. inside-chroot path would have been \(lq/\(rq.
  157. .IP
  158. When \(lquse chroot\(rq is false or the inside-chroot path is not \(lq/\(rq, rsync will:
  159. (1) munge symlinks by
  160. default for security reasons (see \(lqmunge symlinks\(rq for a way to turn this
  161. off, but only if you trust your users), (2) substitute leading slashes in
  162. absolute paths with the module's path (so that options such as
  163. \fB\-\-backup\-dir\fP, \fB\-\-compare\-dest\fP, etc. interpret an absolute path as
  164. rooted in the module's \(lqpath\(rq dir), and (3) trim \(lq..\(rq path elements from
  165. args if rsync believes they would escape the module hierarchy.
  166. The default for \(lquse chroot\(rq is true, and is the safer choice (especially
  167. if the module is not read-only).
  168. .IP
  169. When this parameter is enabled, rsync will not attempt to map users and groups
  170. by name (by default), but instead copy IDs as though \fB\-\-numeric\-ids\fP had
  171. been specified. In order to enable name-mapping, rsync needs to be able to
  172. use the standard library functions for looking up names and IDs (i.e.
  173. \f(CWgetpwuid()\fP
  174. ,
  175. \f(CWgetgrgid()\fP
  176. ,
  177. \f(CWgetpwname()\fP
  178. , and
  179. \f(CWgetgrnam()\fP
  180. ).
  181. This means the rsync
  182. process in the chroot hierarchy will need to have access to the resources
  183. used by these library functions (traditionally /etc/passwd and
  184. /etc/group, but perhaps additional dynamic libraries as well).
  185. .IP
  186. If you copy the necessary resources into the module's chroot area, you
  187. should protect them through your OS's normal user/group or ACL settings (to
  188. prevent the rsync module's user from being able to change them), and then
  189. hide them from the user's view via \(lqexclude\(rq (see how in the discussion of
  190. that parameter). At that point it will be safe to enable the mapping of users
  191. and groups by name using the \(lqnumeric ids\(rq daemon parameter (see below).
  192. .IP
  193. Note also that you are free to setup custom user/group information in the
  194. chroot area that is different from your normal system. For example, you
  195. could abbreviate the list of users and groups.
  196. .IP
  197. .IP "\fBnumeric ids\fP"
  198. Enabling this parameter disables the mapping
  199. of users and groups by name for the current daemon module. This prevents
  200. the daemon from trying to load any user/group-related files or libraries.
  201. This enabling makes the transfer behave as if the client had passed
  202. the \fB\-\-numeric\-ids\fP command-line option. By default, this parameter is
  203. enabled for chroot modules and disabled for non-chroot modules.
  204. .IP
  205. A chroot-enabled module should not have this parameter enabled unless you've
  206. taken steps to ensure that the module has the necessary resources it needs
  207. to translate names, and that it is not possible for a user to change those
  208. resources.
  209. .IP
  210. .IP "\fBmunge symlinks\fP"
  211. This parameter tells rsync to modify
  212. all incoming symlinks in a way that makes them unusable but recoverable
  213. (see below). This should help protect your files from user trickery when
  214. your daemon module is writable. The default is disabled when \(lquse chroot\(rq
  215. is on and the inside-chroot path is \(lq/\(rq, otherwise it is enabled.
  216. .IP
  217. If you disable this parameter on a daemon that is not read-only, there
  218. are tricks that a user can play with uploaded symlinks to access
  219. daemon-excluded items (if your module has any), and, if \(lquse chroot\(rq
  220. is off, rsync can even be tricked into showing or changing data that
  221. is outside the module's path (as access-permissions allow).
  222. .IP
  223. The way rsync disables the use of symlinks is to prefix each one with
  224. the string \(lq/rsyncd-munged/\(rq. This prevents the links from being used
  225. as long as that directory does not exist. When this parameter is enabled,
  226. rsync will refuse to run if that path is a directory or a symlink to
  227. a directory. When using the \(lqmunge symlinks\(rq parameter in a chroot area
  228. that has an inside-chroot path of \(lq/\(rq, you should add \(lq/rsyncd-munged/\(rq
  229. to the exclude setting for the module so that
  230. a user can't try to create it.
  231. .IP
  232. Note: rsync makes no attempt to verify that any pre-existing symlinks in
  233. the module's hierarchy are as safe as you want them to be (unless, of
  234. course, it just copied in the whole hierarchy). If you setup an rsync
  235. daemon on a new area or locally add symlinks, you can manually protect your
  236. symlinks from being abused by prefixing \(lq/rsyncd-munged/\(rq to the start of
  237. every symlink's value. There is a perl script in the support directory
  238. of the source code named \(lqmunge-symlinks\(rq that can be used to add or remove
  239. this prefix from your symlinks.
  240. .IP
  241. When this parameter is disabled on a writable module and \(lquse chroot\(rq is off
  242. (or the inside-chroot path is not \(lq/\(rq),
  243. incoming symlinks will be modified to drop a leading slash and to remove \(lq..\(rq
  244. path elements that rsync believes will allow a symlink to escape the module's
  245. hierarchy. There are tricky ways to work around this, though, so you had
  246. better trust your users if you choose this combination of parameters.
  247. .IP
  248. .IP "\fBcharset\fP"
  249. This specifies the name of the character set in which the
  250. module's filenames are stored. If the client uses an \fB\-\-iconv\fP option,
  251. the daemon will use the value of the \(lqcharset\(rq parameter regardless of the
  252. character set the client actually passed. This allows the daemon to
  253. support charset conversion in a chroot module without extra files in the
  254. chroot area, and also ensures that name-translation is done in a consistent
  255. manner. If the \(lqcharset\(rq parameter is not set, the \fB\-\-iconv\fP option is
  256. refused, just as if \(lqiconv\(rq had been specified via \(lqrefuse options\(rq.
  257. .IP
  258. If you wish to force users to always use \fB\-\-iconv\fP for a particular
  259. module, add \(lqno-iconv\(rq to the \(lqrefuse options\(rq parameter. Keep in mind
  260. that this will restrict access to your module to very new rsync clients.
  261. .IP
  262. .IP "\fBmax connections\fP"
  263. This parameter allows you to
  264. specify the maximum number of simultaneous connections you will allow.
  265. Any clients connecting when the maximum has been reached will receive a
  266. message telling them to try later. The default is 0, which means no limit.
  267. A negative value disables the module.
  268. See also the \(lqlock file\(rq parameter.
  269. .IP
  270. .IP "\fBlog file\fP"
  271. When the \(lqlog file\(rq parameter is set to a non-empty
  272. string, the rsync daemon will log messages to the indicated file rather
  273. than using syslog. This is particularly useful on systems (such as AIX)
  274. where
  275. \f(CWsyslog()\fP
  276. doesn't work for chrooted programs. The file is
  277. opened before
  278. \f(CWchroot()\fP
  279. is called, allowing it to be placed outside
  280. the transfer. If this value is set on a per-module basis instead of
  281. globally, the global log will still contain any authorization failures
  282. or config-file error messages.
  283. .IP
  284. If the daemon fails to open the specified file, it will fall back to
  285. using syslog and output an error about the failure. (Note that the
  286. failure to open the specified log file used to be a fatal error.)
  287. .IP
  288. .IP "\fBsyslog facility\fP"
  289. This parameter allows you to
  290. specify the syslog facility name to use when logging messages from the
  291. rsync daemon. You may use any standard syslog facility name which is
  292. defined on your system. Common names are auth, authpriv, cron, daemon,
  293. ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0,
  294. local1, local2, local3, local4, local5, local6 and local7. The default
  295. is daemon. This setting has no effect if the \(lqlog file\(rq setting is a
  296. non-empty string (either set in the per-modules settings, or inherited
  297. from the global settings).
  298. .IP
  299. .IP "\fBmax verbosity\fP"
  300. This parameter allows you to control
  301. the maximum amount of verbose information that you'll allow the daemon to
  302. generate (since the information goes into the log file). The default is 1,
  303. which allows the client to request one level of verbosity.
  304. .IP
  305. .IP "\fBlock file\fP"
  306. This parameter specifies the file to use to
  307. support the \(lqmax connections\(rq parameter. The rsync daemon uses record
  308. locking on this file to ensure that the max connections limit is not
  309. exceeded for the modules sharing the lock file.
  310. The default is \f(CW/var/run/rsyncd.lock\fP.
  311. .IP
  312. .IP "\fBread only\fP"
  313. This parameter determines whether clients
  314. will be able to upload files or not. If \(lqread only\(rq is true then any
  315. attempted uploads will fail. If \(lqread only\(rq is false then uploads will
  316. be possible if file permissions on the daemon side allow them. The default
  317. is for all modules to be read only.
  318. .IP
  319. .IP "\fBwrite only\fP"
  320. This parameter determines whether clients
  321. will be able to download files or not. If \(lqwrite only\(rq is true then any
  322. attempted downloads will fail. If \(lqwrite only\(rq is false then downloads
  323. will be possible if file permissions on the daemon side allow them. The
  324. default is for this parameter to be disabled.
  325. .IP
  326. .IP "\fBlist\fP"
  327. This parameter determines if this module should be
  328. listed when the client asks for a listing of available modules. By
  329. setting this to false you can create hidden modules. The default is
  330. for modules to be listable.
  331. .IP
  332. .IP "\fBuid\fP"
  333. This parameter specifies the user name or user ID that
  334. file transfers to and from that module should take place as when the daemon
  335. was run as root. In combination with the \(lqgid\(rq parameter this determines what
  336. file permissions are available. The default is uid \-2, which is normally
  337. the user \(lqnobody\(rq.
  338. .IP
  339. .IP "\fBgid\fP"
  340. This parameter specifies the group name or group ID that
  341. file transfers to and from that module should take place as when the daemon
  342. was run as root. This complements the \(lquid\(rq parameter. The default is gid \-2,
  343. which is normally the group \(lqnobody\(rq.
  344. .IP
  345. .IP "\fBfake super\fP"
  346. Setting \(lqfake super = yes\(rq for a module causes the
  347. daemon side to behave as if the \fB\-\-fake\-user\fP command-line option had
  348. been specified. This allows the full attributes of a file to be stored
  349. without having to have the daemon actually running as root.
  350. .IP
  351. .IP "\fBfilter\fP"
  352. The daemon has its own filter chain that determines what files
  353. it will let the client access. This chain is not sent to the client and is
  354. independent of any filters the client may have specified. Files excluded by
  355. the daemon filter chain (\fBdaemon-excluded\fP files) are treated as non-existent
  356. if the client tries to pull them, are skipped with an error message if the
  357. client tries to push them (triggering exit code 23), and are never deleted from
  358. the module. You can use daemon filters to prevent clients from downloading or
  359. tampering with private administrative files, such as files you may add to
  360. support uid/gid name translations.
  361. .IP
  362. The daemon filter chain is built from the \(lqfilter\(rq, \(lqinclude from\(rq, \(lqinclude\(rq,
  363. \(lqexclude from\(rq, and \(lqexclude\(rq parameters, in that order of priority. Anchored
  364. patterns are anchored at the root of the module. To prevent access to an
  365. entire subtree, for example, \(lq/secret\(rq, you \fImust\fP exclude everything in the
  366. subtree; the easiest way to do this is with a triple-star pattern like
  367. \(lq/secret/***\(rq.
  368. .IP
  369. The \(lqfilter\(rq parameter takes a space-separated list of daemon filter rules,
  370. though it is smart enough to know not to split a token at an internal space in
  371. a rule (e.g. \(lq\- /foo \(em /bar\(rq is parsed as two rules). You may specify one or
  372. more merge-file rules using the normal syntax. Only one \(lqfilter\(rq parameter can
  373. apply to a given module in the config file, so put all the rules you want in a
  374. single parameter. Note that per-directory merge-file rules do not provide as
  375. much protection as global rules, but they can be used to make \fB\-\-delete\fP work
  376. better during a client download operation if the per-dir merge files are
  377. included in the transfer and the client requests that they be used.
  378. .IP
  379. .IP "\fBexclude\fP"
  380. This parameter takes a space-separated list of daemon
  381. exclude patterns. As with the client \fB\-\-exclude\fP option, patterns can be
  382. qualified with \(lq\- \(rq or \(lq+ \(rq to explicitly indicate exclude/include. Only one
  383. \(lqexclude\(rq parameter can apply to a given module. See the \(lqfilter\(rq parameter
  384. for a description of how excluded files affect the daemon.
  385. .IP
  386. .IP "\fBinclude\fP"
  387. Use an \(lqinclude\(rq to override the effects of the \(lqexclude\(rq
  388. parameter. Only one \(lqinclude\(rq parameter can apply to a given module. See the
  389. \(lqfilter\(rq parameter for a description of how excluded files affect the daemon.
  390. .IP
  391. .IP "\fBexclude from\fP"
  392. This parameter specifies the name of a file
  393. on the daemon that contains daemon exclude patterns, one per line. Only one
  394. \(lqexclude from\(rq parameter can apply to a given module; if you have multiple
  395. exclude-from files, you can specify them as a merge file in the \(lqfilter\(rq
  396. parameter. See the \(lqfilter\(rq parameter for a description of how excluded files
  397. affect the daemon.
  398. .IP
  399. .IP "\fBinclude from\fP"
  400. Analogue of \(lqexclude from\(rq for a file of daemon include
  401. patterns. Only one \(lqinclude from\(rq parameter can apply to a given module. See
  402. the \(lqfilter\(rq parameter for a description of how excluded files affect the
  403. daemon.
  404. .IP
  405. .IP "\fBincoming chmod\fP"
  406. This parameter allows you to specify a set of
  407. comma-separated chmod strings that will affect the permissions of all
  408. incoming files (files that are being received by the daemon). These
  409. changes happen after all other permission calculations, and this will
  410. even override destination-default and/or existing permissions when the
  411. client does not specify \fB\-\-perms\fP.
  412. See the description of the \fB\-\-chmod\fP rsync option and the \fBchmod\fP(1)
  413. manpage for information on the format of this string.
  414. .IP
  415. .IP "\fBoutgoing chmod\fP"
  416. This parameter allows you to specify a set of
  417. comma-separated chmod strings that will affect the permissions of all
  418. outgoing files (files that are being sent out from the daemon). These
  419. changes happen first, making the sent permissions appear to be different
  420. than those stored in the filesystem itself. For instance, you could
  421. disable group write permissions on the server while having it appear to
  422. be on to the clients.
  423. See the description of the \fB\-\-chmod\fP rsync option and the \fBchmod\fP(1)
  424. manpage for information on the format of this string.
  425. .IP
  426. .IP "\fBauth users\fP"
  427. This parameter specifies a comma and
  428. space-separated list of usernames that will be allowed to connect to
  429. this module. The usernames do not need to exist on the local
  430. system. The usernames may also contain shell wildcard characters. If
  431. \(lqauth users\(rq is set then the client will be challenged to supply a
  432. username and password to connect to the module. A challenge response
  433. authentication protocol is used for this exchange. The plain text
  434. usernames and passwords are stored in the file specified by the
  435. \(lqsecrets file\(rq parameter. The default is for all users to be able to
  436. connect without a password (this is called \(lqanonymous rsync\(rq).
  437. .IP
  438. See also the \(lqCONNECTING TO AN RSYNC DAEMON OVER A REMOTE SHELL
  439. PROGRAM\(rq section in \fBrsync\fP(1) for information on how handle an
  440. rsyncd.conf\-level username that differs from the remote-shell-level
  441. username when using a remote shell to connect to an rsync daemon.
  442. .IP
  443. .IP "\fBsecrets file\fP"
  444. This parameter specifies the name of
  445. a file that contains the username:password pairs used for
  446. authenticating this module. This file is only consulted if the \(lqauth
  447. users\(rq parameter is specified. The file is line based and contains
  448. username:password pairs separated by a single colon. Any line starting
  449. with a hash (#) is considered a comment and is skipped. The passwords
  450. can contain any characters but be warned that many operating systems
  451. limit the length of passwords that can be typed at the client end, so
  452. you may find that passwords longer than 8 characters don't work.
  453. .IP
  454. There is no default for the \(lqsecrets file\(rq parameter, you must choose a name
  455. (such as \f(CW/etc/rsyncd.secrets\fP). The file must normally not be readable
  456. by \(lqother\(rq; see \(lqstrict modes\(rq.
  457. .IP
  458. .IP "\fBstrict modes\fP"
  459. This parameter determines whether or not
  460. the permissions on the secrets file will be checked. If \(lqstrict modes\(rq is
  461. true, then the secrets file must not be readable by any user ID other
  462. than the one that the rsync daemon is running under. If \(lqstrict modes\(rq is
  463. false, the check is not performed. The default is true. This parameter
  464. was added to accommodate rsync running on the Windows operating system.
  465. .IP
  466. .IP "\fBhosts allow\fP"
  467. This parameter allows you to specify a
  468. list of patterns that are matched against a connecting clients
  469. hostname and IP address. If none of the patterns match then the
  470. connection is rejected.
  471. .IP
  472. Each pattern can be in one of five forms:
  473. .IP
  474. .RS
  475. .IP o
  476. a dotted decimal IPv4 address of the form a.b.c.d, or an IPv6 address
  477. of the form a:b:c::d:e:f. In this case the incoming machine's IP address
  478. must match exactly.
  479. .IP o
  480. an address/mask in the form ipaddr/n where ipaddr is the IP address
  481. and n is the number of one bits in the netmask. All IP addresses which
  482. match the masked IP address will be allowed in.
  483. .IP o
  484. an address/mask in the form ipaddr/maskaddr where ipaddr is the
  485. IP address and maskaddr is the netmask in dotted decimal notation for IPv4,
  486. or similar for IPv6, e.g. ffff:ffff:ffff:ffff:: instead of /64. All IP
  487. addresses which match the masked IP address will be allowed in.
  488. .IP o
  489. a hostname. The hostname as determined by a reverse lookup will
  490. be matched (case insensitive) against the pattern. Only an exact
  491. match is allowed in.
  492. .IP o
  493. a hostname pattern using wildcards. These are matched using the
  494. same rules as normal unix filename matching. If the pattern matches
  495. then the client is allowed in.
  496. .RE
  497. .IP
  498. Note IPv6 link-local addresses can have a scope in the address specification:
  499. .IP
  500. .RS
  501. \f(CW fe80::1%link1\fP
  502. .br
  503. \f(CW fe80::%link1/64\fP
  504. .br
  505. \f(CW fe80::%link1/ffff:ffff:ffff:ffff::\fP
  506. .br
  507. .RE
  508. .IP
  509. You can also combine \(lqhosts allow\(rq with a separate \(lqhosts deny\(rq
  510. parameter. If both parameters are specified then the \(lqhosts allow\(rq parameter is
  511. checked first and a match results in the client being able to
  512. connect. The \(lqhosts deny\(rq parameter is then checked and a match means
  513. that the host is rejected. If the host does not match either the
  514. \(lqhosts allow\(rq or the \(lqhosts deny\(rq patterns then it is allowed to
  515. connect.
  516. .IP
  517. The default is no \(lqhosts allow\(rq parameter, which means all hosts can connect.
  518. .IP
  519. .IP "\fBhosts deny\fP"
  520. This parameter allows you to specify a
  521. list of patterns that are matched against a connecting clients
  522. hostname and IP address. If the pattern matches then the connection is
  523. rejected. See the \(lqhosts allow\(rq parameter for more information.
  524. .IP
  525. The default is no \(lqhosts deny\(rq parameter, which means all hosts can connect.
  526. .IP
  527. .IP "\fBignore errors\fP"
  528. This parameter tells rsyncd to
  529. ignore I/O errors on the daemon when deciding whether to run the delete
  530. phase of the transfer. Normally rsync skips the \fB\-\-delete\fP step if any
  531. I/O errors have occurred in order to prevent disastrous deletion due
  532. to a temporary resource shortage or other I/O error. In some cases this
  533. test is counter productive so you can use this parameter to turn off this
  534. behavior.
  535. .IP
  536. .IP "\fBignore nonreadable\fP"
  537. This tells the rsync daemon to completely
  538. ignore files that are not readable by the user. This is useful for
  539. public archives that may have some non-readable files among the
  540. directories, and the sysadmin doesn't want those files to be seen at all.
  541. .IP
  542. .IP "\fBtransfer logging\fP"
  543. This parameter enables per-file
  544. logging of downloads and uploads in a format somewhat similar to that
  545. used by ftp daemons. The daemon always logs the transfer at the end, so
  546. if a transfer is aborted, no mention will be made in the log file.
  547. .IP
  548. If you want to customize the log lines, see the \(lqlog format\(rq parameter.
  549. .IP
  550. .IP "\fBlog format\fP"
  551. This parameter allows you to specify the
  552. format used for logging file transfers when transfer logging is enabled.
  553. The format is a text string containing embedded single-character escape
  554. sequences prefixed with a percent (%) character. An optional numeric
  555. field width may also be specified between the percent and the escape
  556. letter (e.g. \(lq\fB%\-50n %8l %07p\fP\(rq).
  557. .IP
  558. The default log format is \(lq%o %h [%a] %m (%u) %f %l\(rq, and a \(lq%t [%p] \(rq
  559. is always prefixed when using the \(lqlog file\(rq parameter.
  560. (A perl script that will summarize this default log format is included
  561. in the rsync source code distribution in the \(lqsupport\(rq subdirectory:
  562. rsyncstats.)
  563. .IP
  564. The single-character escapes that are understood are as follows:
  565. .IP
  566. .RS
  567. .IP o
  568. %a the remote IP address
  569. .IP o
  570. %b the number of bytes actually transferred
  571. .IP o
  572. %B the permission bits of the file (e.g. rwxrwxrwt)
  573. .IP o
  574. %c the total size of the block checksums received for the basis file (only when sending)
  575. .IP o
  576. %f the filename (long form on sender; no trailing \(lq/\(rq)
  577. .IP o
  578. %G the gid of the file (decimal) or \(lqDEFAULT\(rq
  579. .IP o
  580. %h the remote host name
  581. .IP o
  582. %i an itemized list of what is being updated
  583. .IP o
  584. %l the length of the file in bytes
  585. .IP o
  586. %L the string \(lq \-> SYMLINK\(rq, \(lq => HARDLINK\(rq, or \(lq\(rq (where \fBSYMLINK\fP or \fBHARDLINK\fP is a filename)
  587. .IP o
  588. %m the module name
  589. .IP o
  590. %M the last-modified time of the file
  591. .IP o
  592. %n the filename (short form; trailing \(lq/\(rq on dir)
  593. .IP o
  594. %o the operation, which is \(lqsend\(rq, \(lqrecv\(rq, or \(lqdel.\(rq (the latter includes the trailing period)
  595. .IP o
  596. %p the process ID of this rsync session
  597. .IP o
  598. %P the module path
  599. .IP o
  600. %t the current date time
  601. .IP o
  602. %u the authenticated username or an empty string
  603. .IP o
  604. %U the uid of the file (decimal)
  605. .RE
  606. .IP
  607. For a list of what the characters mean that are output by \(lq%i\(rq, see the
  608. \fB\-\-itemize\-changes\fP option in the rsync manpage.
  609. .IP
  610. Note that some of the logged output changes when talking with older
  611. rsync versions. For instance, deleted files were only output as verbose
  612. messages prior to rsync 2.6.4.
  613. .IP
  614. .IP "\fBtimeout\fP"
  615. This parameter allows you to override the
  616. clients choice for I/O timeout for this module. Using this parameter you
  617. can ensure that rsync won't wait on a dead client forever. The timeout
  618. is specified in seconds. A value of zero means no timeout and is the
  619. default. A good choice for anonymous rsync daemons may be 600 (giving
  620. a 10 minute timeout).
  621. .IP
  622. .IP "\fBrefuse options\fP"
  623. This parameter allows you to
  624. specify a space-separated list of rsync command line options that will
  625. be refused by your rsync daemon.
  626. You may specify the full option name, its one-letter abbreviation, or a
  627. wild-card string that matches multiple options.
  628. For example, this would refuse \fB\-\-checksum\fP (\fB\-c\fP) and all the various
  629. delete options:
  630. .IP
  631. .RS
  632. \f(CW refuse options = c delete\fP
  633. .RE
  634. .IP
  635. The reason the above refuses all delete options is that the options imply
  636. \fB\-\-delete\fP, and implied options are refused just like explicit options.
  637. As an additional safety feature, the refusal of \(lqdelete\(rq also refuses
  638. \fBremove-source-files\fP when the daemon is the sender; if you want the latter
  639. without the former, instead refuse \(lqdelete\-*\(rq \(em that refuses all the
  640. delete modes without affecting \fB\-\-remove\-source\-files\fP.
  641. .IP
  642. When an option is refused, the daemon prints an error message and exits.
  643. To prevent all compression when serving files,
  644. you can use \(lqdont compress = *\(rq (see below)
  645. instead of \(lqrefuse options = compress\(rq to avoid returning an error to a
  646. client that requests compression.
  647. .IP
  648. .IP "\fBdont compress\fP"
  649. This parameter allows you to select
  650. filenames based on wildcard patterns that should not be compressed
  651. when pulling files from the daemon (no analogous parameter exists to
  652. govern the pushing of files to a daemon).
  653. Compression is expensive in terms of CPU usage, so it
  654. is usually good to not try to compress files that won't compress well,
  655. such as already compressed files.
  656. .IP
  657. The \(lqdont compress\(rq parameter takes a space-separated list of
  658. case-insensitive wildcard patterns. Any source filename matching one
  659. of the patterns will not be compressed during transfer.
  660. .IP
  661. See the \fB\-\-skip\-compress\fP parameter in the \fBrsync\fP(1) manpage for the list
  662. of file suffixes that are not compressed by default. Specifying a value
  663. for the \(lqdont compress\(rq parameter changes the default when the daemon is
  664. the sender.
  665. .IP
  666. .IP "\fBpre-xfer exec\fP, \fBpost-xfer exec\fP"
  667. You may specify a command to be run
  668. before and/or after the transfer. If the \fBpre-xfer exec\fP command fails, the
  669. transfer is aborted before it begins.
  670. .IP
  671. The following environment variables will be set, though some are
  672. specific to the pre-xfer or the post-xfer environment:
  673. .IP
  674. .RS
  675. .IP o
  676. \fBRSYNC_MODULE_NAME\fP: The name of the module being accessed.
  677. .IP o
  678. \fBRSYNC_MODULE_PATH\fP: The path configured for the module.
  679. .IP o
  680. \fBRSYNC_HOST_ADDR\fP: The accessing host's IP address.
  681. .IP o
  682. \fBRSYNC_HOST_NAME\fP: The accessing host's name.
  683. .IP o
  684. \fBRSYNC_USER_NAME\fP: The accessing user's name (empty if no user).
  685. .IP o
  686. \fBRSYNC_PID\fP: A unique number for this transfer.
  687. .IP o
  688. \fBRSYNC_REQUEST\fP: (pre-xfer only) The module/path info specified
  689. by the user (note that the user can specify multiple source files,
  690. so the request can be something like \(lqmod/path1 mod/path2\(rq, etc.).
  691. .IP o
  692. \fBRSYNC_ARG#\fP: (pre-xfer only) The pre-request arguments are set
  693. in these numbered values. RSYNC_ARG0 is always \(lqrsyncd\(rq, and the last
  694. value contains a single period.
  695. .IP o
  696. \fBRSYNC_EXIT_STATUS\fP: (post-xfer only) the server side's exit value.
  697. This will be 0 for a successful run, a positive value for an error that the
  698. server generated, or a \-1 if rsync failed to exit properly. Note that an
  699. error that occurs on the client side does not currently get sent to the
  700. server side, so this is not the final exit status for the whole transfer.
  701. .IP o
  702. \fBRSYNC_RAW_STATUS\fP: (post-xfer only) the raw exit value from
  703. \f(CWwaitpid()\fP
  704. \&.
  705. .RE
  706. .IP
  707. Even though the commands can be associated with a particular module, they
  708. are run using the permissions of the user that started the daemon (not the
  709. module's uid/gid setting) without any chroot restrictions.
  710. .IP
  711. .SH "AUTHENTICATION STRENGTH"
  712. .PP
  713. The authentication protocol used in rsync is a 128 bit MD4 based
  714. challenge response system. This is fairly weak protection, though (with
  715. at least one brute-force hash-finding algorithm publicly available), so
  716. if you want really top-quality security, then I recommend that you run
  717. rsync over ssh. (Yes, a future version of rsync will switch over to a
  718. stronger hashing method.)
  719. .PP
  720. Also note that the rsync daemon protocol does not currently provide any
  721. encryption of the data that is transferred over the connection. Only
  722. authentication is provided. Use ssh as the transport if you want
  723. encryption.
  724. .PP
  725. Future versions of rsync may support SSL for better authentication and
  726. encryption, but that is still being investigated.
  727. .PP
  728. .SH "EXAMPLES"
  729. .PP
  730. A simple rsyncd.conf file that allow anonymous rsync to a ftp area at
  731. \f(CW/home/ftp\fP would be:
  732. .PP
  733. .nf
  734. [ftp]
  735. path = /home/ftp
  736. comment = ftp export area
  737. .fi
  738. .PP
  739. A more sophisticated example would be:
  740. .PP
  741. .nf
  742. uid = nobody
  743. gid = nobody
  744. use chroot = yes
  745. max connections = 4
  746. syslog facility = local5
  747. pid file = /var/run/rsyncd.pid
  748. [ftp]
  749. path = /var/ftp/./pub
  750. comment = whole ftp area (approx 6.1 GB)
  751. [sambaftp]
  752. path = /var/ftp/./pub/samba
  753. comment = Samba ftp area (approx 300 MB)
  754. [rsyncftp]
  755. path = /var/ftp/./pub/rsync
  756. comment = rsync ftp area (approx 6 MB)
  757. [sambawww]
  758. path = /public_html/samba
  759. comment = Samba WWW pages (approx 240 MB)
  760. [cvs]
  761. path = /data/cvs
  762. comment = CVS repository (requires authentication)
  763. auth users = tridge, susan
  764. secrets file = /etc/rsyncd.secrets
  765. .fi
  766. .PP
  767. The /etc/rsyncd.secrets file would look something like this:
  768. .PP
  769. .RS
  770. \f(CWtridge:mypass\fP
  771. .br
  772. \f(CWsusan:herpass\fP
  773. .br
  774. .RE
  775. .PP
  776. .SH "FILES"
  777. .PP
  778. /etc/rsyncd.conf or rsyncd.conf
  779. .PP
  780. .SH "SEE ALSO"
  781. .PP
  782. \fBrsync\fP(1)
  783. .PP
  784. .SH "DIAGNOSTICS"
  785. .PP
  786. .SH "BUGS"
  787. .PP
  788. Please report bugs! The rsync bug tracking system is online at
  789. http://rsync.samba.org/
  790. .PP
  791. .SH "VERSION"
  792. .PP
  793. This man page is current for version 3.0.4 of rsync.
  794. .PP
  795. .SH "CREDITS"
  796. .PP
  797. rsync is distributed under the GNU public license. See the file
  798. COPYING for details.
  799. .PP
  800. The primary ftp site for rsync is
  801. ftp://rsync.samba.org/pub/rsync.
  802. .PP
  803. A WEB site is available at
  804. http://rsync.samba.org/
  805. .PP
  806. We would be delighted to hear from you if you like this program.
  807. .PP
  808. This program uses the zlib compression library written by Jean-loup
  809. Gailly and Mark Adler.
  810. .PP
  811. .SH "THANKS"
  812. .PP
  813. Thanks to Warren Stanley for his original idea and patch for the rsync
  814. daemon. Thanks to Karsten Thygesen for his many suggestions and
  815. documentation!
  816. .PP
  817. .SH "AUTHOR"
  818. .PP
  819. rsync was written by Andrew Tridgell and Paul Mackerras.
  820. Many people have later contributed to it.
  821. .PP
  822. Mailing lists for support and development are available at
  823. http://lists.samba.org