rsyncd.conf.5 36 KB

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