home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / adduser / examples / adduser.local.conf next >
Encoding:
Text File  |  2006-07-10  |  20.3 KB  |  579 lines

  1. ############################################################################
  2. # /etc/adduser.local.conf: Configuration for /usr/local/sbin/adduser.local #
  3. ############################################################################
  4.  
  5. # [JNZ] Modified 23-Sep-2004
  6.  
  7. # This file configures the local system additions to adduser(8) and should
  8. # be modified to suit local conditions.
  9. #
  10. # adduser.local is a script that configures a user's account for various
  11. # "services".  These services are simply convenient names for directories
  12. # that must be created, Unix groups to which the user must be added, files
  13. # that need to be copied and so on.
  14. #
  15. # Please see the end of this file for an explanation of its syntax.
  16.  
  17.  
  18. ######################
  19. #   Global Options   #
  20. ######################
  21.  
  22. # The "skelother" variable points to the "other" skeletal directory.  This
  23. # directory is similar to /etc/skel (see the SKEL variable in
  24. # /etc/adduser.conf), except that files are not necessarily copied to the
  25. # home directory.
  26.  
  27. skelother = /etc/skel.other
  28.  
  29. # The "dirmode" variable specifies the octal mode used by chmod(1) for any
  30. # directories created by adduser.local.  Note, however, that such created
  31. # directories automatically inherit the SGID (set group ID) bit from their
  32. # parent directory.
  33.  
  34. dirmode = 0755
  35.  
  36. # The "filemode" variable specifies the octal mode used by chmod(1) for
  37. # any files created by adduser.local.
  38.  
  39. filemode = 0644
  40.  
  41.  
  42. #####################
  43. #   USERS service   #
  44. #####################
  45.  
  46. # Add the user to the Unix group "users".  Every user on this machine
  47. # should be a member of this group.  This is already done if the file
  48. # /etc/adduser.conf includes the setting "USERGROUPS=no".  If USERGROUPS
  49. # is set to "yes", you should uncomment the following three lines.
  50.  
  51. # service = users
  52. # group[users] = users
  53. # addtogroup[users] = true
  54.  
  55.  
  56. ###################
  57. #   WWW service   #
  58. ###################
  59.  
  60. # Configure the WWW service for the user, a service that has a real UID
  61. # associated with it.  Assuming the user "www" has a GID of "www" and a
  62. # home directory of "/home/www" (in actual fact, the values are taken from
  63. # the password database), the following actions are performed:
  64. #   - the user is added to the "www" group
  65. #   - the directory "/home/www/doc/users/$USER" is created, owned by
  66. #     the user, with group owner "www"
  67. #   - the link "public_html" is created to point to this directory
  68. #   - the file "/etc/skel.other/index.html" is copied to this directory
  69. # This assumes that the system user "www" and group "www" are NOT the same
  70. # as the UID and GID of the web server ("www-data" on my system).  The
  71. # "www" account is for the web administrator.
  72.  
  73. service = www
  74.  
  75. user[www]       = www
  76. addtogroup[www] = true
  77. homedir[www]    = ""
  78. subdir[www]     = "doc/users"
  79. althome[www]    = false
  80. mkdir[www]      = true
  81. chgrpdir[www]   = true
  82. mklink[www]     = true
  83. linkname[www]   = "public_html"
  84. skelfile[www]   = "index.html"
  85. chgrpskel[www]  = true
  86.  
  87. # If your web server's configuration follows the "other" standard for
  88. # personal web pages (wherein the "public_html" directory is a real
  89. # directory in the user's home directory), you might want to use something
  90. # like the following:
  91.  
  92. # service = www
  93. # homedir[www] = ""
  94. # subdir[www] = "public_html"
  95. # althome[www] = true
  96. # mkdir[www] = true
  97. # skelfile[www] = "index.html"
  98.  
  99.  
  100. ###################
  101. #   FTP service   #
  102. ###################
  103.  
  104. # Configure the FTP service for the user in a similar way to the WWW
  105. # service above.  The only difference is that no skeleton file is copied.
  106.  
  107. service = ftp
  108.  
  109. user[ftp]       = ftp
  110. addtogroup[ftp] = true
  111. homedir[ftp]    = ""
  112. subdir[ftp]     = "doc/users"
  113. althome[ftp]    = false
  114. mkdir[ftp]      = true
  115. chgrpdir[ftp]   = true
  116. mklink[ftp]     = true
  117. linkname[ftp]   = "public_ftp"
  118.  
  119.  
  120. ####################
  121. #   DATA service   #
  122. ####################
  123.  
  124. # Create the directory /data/$USER, owned by the user.  This is only done
  125. # if /data exists (it is an ordinary directory, not a mount point).
  126.  
  127. service = data
  128.  
  129. homedir[data] = "/data"
  130. subdir[data]  = ""
  131. mounted[data] = false
  132. mkdir[data]   = true
  133.  
  134.  
  135. ###################
  136. #   ZIP service   #
  137. ###################
  138.  
  139. # Create the directory /media/zip/home/$USER, owned by the user.  This is
  140. # only done if /media/zip exists and some device is mounted on it at the
  141. # time the adduser.local script is run.
  142.  
  143. service = zip
  144.  
  145. homedir[zip] = "/media/zip"
  146. subdir[zip]  = "home"
  147. mounted[zip] = true
  148. mkdir[zip]   = true
  149.  
  150.  
  151. #####################
  152. #   CDROM service   #
  153. #####################
  154.  
  155. # Add the user to the Unix group "cdrom" (if it exists).  This allows the
  156. # user to access the CD-ROM hardware on the machine.
  157.  
  158. service = cdrom
  159. group[cdrom] = cdrom
  160. addtogroup[cdrom] = true
  161.  
  162.  
  163. ######################
  164. #   FLOPPY service   #
  165. ######################
  166.  
  167. # Add the user to the Unix group "floppy" (if it exists).  This allows the
  168. # user to access the floppy drive on the machine.
  169.  
  170. service = floppy
  171. group[floppy] = floppy
  172. addtogroup[floppy] = true
  173.  
  174.  
  175. #####################
  176. #   AUDIO service   #
  177. #####################
  178.  
  179. # Add the user to the Unix group "audio" (if it exists).  This allows the
  180. # user to access the audio hardware on the machine.
  181.  
  182. service = audio
  183. group[audio] = audio
  184. addtogroup[audio] = true
  185.  
  186.  
  187. ###################
  188. #   DIP service   #
  189. ###################
  190.  
  191. # Add the user to the Unix group "dip" (if it exists).  This allows the
  192. # user to dial out using the local modem.
  193.  
  194. service = dip
  195. group[dip] = dip
  196. addtogroup[dip] = true
  197.  
  198.  
  199. ###########################
  200. #   Syntax of this file   #
  201. ###########################
  202.  
  203. # The syntax of this file will be familiar to anyone who has used a
  204. # scripting language before.  This file is processed line by line, with
  205. # each line either being blank (and hence ignored), a comment or a
  206. # configuration variable.
  207. #
  208. # Comment lines (such as this one) begin with a hash character ("#") and
  209. # continue to the end of the line.  The hash character may be preceded by
  210. # white space.  Comment lines, like blank lines, are ignored.
  211. #
  212. # All lines that are not blank or are comment lines contain configuration
  213. # variables (one per line, with no comments).  A configuration variable
  214. # has one of two forms:
  215. #
  216. #     variable = value
  217. #     variable[service] = value
  218. #
  219. # The first form is for global variables, while the second form is for
  220. # variables associated with a particular service.  Both the variable name
  221. # and the service name are alphanumeric strings and are case insensitive
  222. # (ie, a variable may be named "SKELOTHER", "skelother" or even
  223. # "SkelOther").
  224. #
  225. # The value is typically a string which may or may not be case sensitive.
  226. # It may be (but usually does not need to be) surrounded by single or
  227. # double quotes, in which case everything within the quotes is part of the
  228. # value.  Note that white space may surround the variable, service and
  229. # value components; such white space is discarded, unless it appears in
  230. # quotes.  You may NOT use backslash to quote quote characters!
  231. #
  232. # If a value takes the form of a boolean, "0", "false" and "no" are
  233. # treated as the false value, while "1", "true" and "yes" are treated as
  234. # the true value.  In both cases, the value is case-insensitive.
  235. #
  236. #
  237. # GLOBAL VARIABLES:
  238. # =================
  239. #
  240. # The following global variables are available:
  241. #
  242. #     skelother
  243. #     dirmode
  244. #     filemode
  245. #
  246. # These are described in the section "Global Options" above.
  247. #
  248. #
  249. # SERVICE VARIABLES:
  250. # ==================
  251. #
  252. # The main role of adduser.local is to configure a user's account for
  253. # various "services".  These services are simply convenient names for
  254. # directories that must be created, Unix groups to which the user must be
  255. # added, files that need to be copied and so on.
  256. #
  257. # adduser.local is informed of the existence of a service by the "service"
  258. # global variable:
  259. #
  260. #     service = servicename
  261. #
  262. # The service name "servicename" may be any case-insensitive alphanumeric
  263. # string.  Examples used within this file are "www" and "zip".  Service
  264. # names need not correspond to any real service --- they are completely
  265. # internal to adduser.local, and are only used as a key for service
  266. # variables.  The "service" global variable may appear multiple times,
  267. # each time with a different service name.
  268. #
  269. # The order of the "service" global variables IS important, as that is the
  270. # order in which those services are created.  This is important if one
  271. # service depends on a prior one having been set up.
  272. #
  273. # The "service" global variable must appear before any of the services
  274. # variables for that service are defined.
  275. #
  276. # The following service variables are available, and may be specified in
  277. # any order:
  278. #
  279. #     user
  280. #     group
  281. #     addtogroup
  282. #     homedir
  283. #     subdir
  284. #     althome
  285. #     mounted
  286. #     mkdir
  287. #     chgrpdir
  288. #     mklink
  289. #     linkname
  290. #     skelfile
  291. #     chgrpskel
  292. #
  293. # Remember that each service variable is followed by a service name in
  294. # square brackets.  In the following explanations, "svc" is used as a
  295. # sample service name.
  296. #
  297. #
  298. # user[svc] = uname
  299. #
  300. #     Specifies that the service belongs to a real user, and that that
  301. #     service user name is "uname".  This user name must appear in the
  302. #     password database file either in the first field (ie, a user name)
  303. #     or in the third (ie, a numeric UID).
  304. #
  305. #     Specifying a user name or UID also sets default values for the
  306. #     "group" and "homedir" service variables.  These default values are
  307. #     taken from the password database (the "homedir" variable is only set
  308. #     if the "althome" variable is set to false).
  309. #
  310. #
  311. # group[svc] = gname
  312. #
  313. #     Specifies that the service's group name is "gname".  This group name
  314. #     must appear in the group database file either in the first field
  315. #     (ie, a group name) or in the third (ie, a numeric GID).
  316. #
  317. #     If this variable is not specified, or is specified with "gname" as
  318. #     an empty string "", and the user variable is specified (and points
  319. #     to a valid user), the group name is taken to be the service user's
  320. #     default group.  For example, if "user[svc] = mail" were to be
  321. #     specified, and group[svc] were not, the group used would be default
  322. #     group for the user "mail" (which happens to be GID 8, ie, "mail").
  323. #
  324. #     This group is also used for the group owner of directories, links
  325. #     and copied files, depending on the settings of the "chgrpdir" and
  326. #     "chgrpskel" variables.
  327. #
  328. #
  329. # addtogroup[svc] = boolean
  330. #
  331. #     Instructs whether to add the user to the group specified by the
  332. #     "group" variable or implied by the "user" variable.  If true,
  333. #     adduser.local adds the user to the group, assuming that the group,
  334. #     in fact, exists.
  335. #
  336. #     If this variable is not specified, false is assumed.
  337. #
  338. #
  339. # homedir[svc] = path
  340. #
  341. #     Specifies the service's home directory as an absolute path name (ie,
  342. #     starting from "/").  The service's home directory is used to check
  343. #     if it is a mount point, as well as a base directory for the "mkdir"
  344. #     and "skelfile" variables.  If the directory does not exist, those
  345. #     variables take no effect.
  346. #
  347. #     If this variable is not specified, or is specified with "path" as an
  348. #     empty string "", the value used for the service's home directory is
  349. #     calculated in one of two ways.  The first method is to use the home
  350. #     directory of the service user; the second is to use the home
  351. #     directory of the user for whom adduser.local was called.
  352. #
  353. #     The first method is used when the "althome" variable is set to false
  354. #     and the "user" variable is specified (and points to a valid user).
  355. #     For example, if "user[svc] = www" and "althome[svc] = false" were to
  356. #     be specified, the default value of the "homedir" variable would be
  357. #     taken from www's home directory, typically "/var/www".
  358. #
  359. #     The second method is used when the "althome" variable is true.  For
  360. #     example, if adduser.local were to be called for the user "anna", and
  361. #     "althome" were set to true, the "homedir" variable would be set to
  362. #     the home directory of anna, typically "/home/anna".
  363. #
  364. #     Note that neither of these methods is used if the "homedir" variable
  365. #     is set to anything other than an empty string; in such a case, the
  366. #     specified value for the variable is always used.
  367. #
  368. #
  369. # subdir[svc] = path
  370. #
  371. #     Specifies a subdirectory off the home directory.  This subdirectory
  372. #     is used for creating the new directory, copying the skeleton file
  373. #     and for the destination of the link.
  374. #
  375. #     If the "althome" variable is set to false, the subdirectory must
  376. #     already exist and is used in conjunction with the home directory and
  377. #     the user's name (for whom adduser.local was called).  For example,
  378. #     if the following were to be specified:
  379. #
  380. #         homedir[svc] = /media/zip
  381. #         subdir[svc] = home
  382. #         althome[svc] = false
  383. #         mkdir[svc] = true
  384. #
  385. #     and the user's name (for whom adduser.local was called) was "james",
  386. #     the directory "/media/zip/home/james" would be created.
  387. #
  388. #     If, on the other hand, the "althome" variable was set to true, the
  389. #     subdirectory is used only in conjunction with the home directory; it
  390. #     is THAT directory that is created.  For example, if the following
  391. #     were to be specified:
  392. #
  393. #         althome[svc] = true
  394. #         subdir[svc] = "public_html"
  395. #         mkdir[svc] = true
  396. #
  397. #     and adduser.local were called for the user "kathy" (who had the home
  398. #     directory "/home/kathy"), the directory "/home/kathy/public_html"
  399. #     would be created.
  400. #
  401. #     and the user's name (for whom adduser.local was called) was "james",
  402. #     the directory "/media/zip/home/james" would be created.
  403. #
  404. #     If this variable is not specified, blank is assumed.
  405. #
  406. #
  407. # althome[svc] = boolean
  408. #
  409. #     Specifies whether the default value for the "homedir" variable is to
  410. #     be taken from the service's home directory or from the user's home
  411. #     directory (for whom adduser.local was called).  If false, the
  412. #     service's home directory (implied by the "user" setting) is used.
  413. #     If true, the actual user's home directory is used.
  414. #
  415. #     This variable also controls whether or not the user's login name is
  416. #     used as part of the directory created by the "mkdir" variable and
  417. #     used by the "mklink" and "skelfile" variables.  See "homedir" and
  418. #     "mklink" for more details.
  419. #
  420. #     If this variable is not specified, false is assumed.
  421. #
  422. #
  423. # mounted[svc] = boolean
  424. #
  425. #     Specifies whether to check if the directory specified by the
  426. #     "homedir" variable (or implied by other variables) is mounted or
  427. #     not.  A directory is mounted if it, or any parent directory, is
  428. #     mounted (excluding the root directory, which is always mounted).
  429. #     For example, if the following were to be specified (and the user's
  430. #     name were "alice"):
  431. #
  432. #         homedir[svc] = /home/external/server/ftp
  433. #         subdir[svc] = doc/users
  434. #         mounted[svc] = true
  435. #         mkdir[svc] = true
  436. #
  437. #     then the directory "/home/external/server/ftp/doc/users/alice" would
  438. #     be created only if either "/home/external/server/ftp",
  439. #     "/home/external/server", "/home/external" or "/home" were mounted.
  440. #
  441. #     If this variable is not specified, false is assumed (ie, the mount
  442. #     check is NOT performed).
  443. #
  444. #     Note that "checking for mounting" is defined as examining the
  445. #     contents of /proc/mounts.  It does NOT actually attempt to mount the
  446. #     directories.
  447. #
  448. #
  449. # mkdir[svc] = boolean
  450. #
  451. #     Directs adduser.local whether or not to create the directory
  452. #     specified by the "homedir" and "subdir" variables.  If the "althome"
  453. #     variable is false, the directory that is created has the user's
  454. #     login name at the end.  In all cases, the newly created directory
  455. #     belongs to that user.  For example, if adduser.local was called for
  456. #     the user "david", and the following lines were to be specified:
  457. #
  458. #         homedir[data1] = "/data/1"
  459. #         subdir[data1] = "users"
  460. #         althome[data1] = false
  461. #         mkdir[data1] = true
  462. #
  463. #     then the directory "/data/1/users/david" would be created, owned by
  464. #     the user "david".  If, on the other hand, the following were to be
  465. #     specified (for the same user "david"):
  466. #
  467. #         subdir[www] = "public_html"
  468. #         althome[www] = true
  469. #         mkdir[www] = true
  470. #
  471. #     then the directory "/home/david/public_html" would be created
  472. #     (assuming "/home/david" was david's home directory), owned by the
  473. #     user "david".
  474. #
  475. #     The mode of the directory is taken from the "dirmode" global
  476. #     variable in this configuration file.  See also the comment on that
  477. #     global variable.
  478. #
  479. #     The group owner of the directory is either the same as the user's
  480. #     (in this case, if the user "david" was in the group "users" by
  481. #     default, then the group owner would be "users"), or the same as the
  482. #     service user's group (see the "group" variable for more
  483. #     information).  The "chgrpdir" variable specifies which of these two
  484. #     options is used.
  485. #
  486. #     If this variable is not specified, false is assumed.
  487. #
  488. #
  489. # chgrpdir[svc] = boolean
  490. #
  491. #     Specifies the group owner of any directory and link created by the
  492. #     "mkdir" and "mklink" variables respectively.  If true is specified,
  493. #     the group owner is the same as specified by the "group" variable (or
  494. #     implied by the "user" variable).  If false is specified, the group
  495. #     owner is the same as the actual user's default group.
  496. #
  497. #     If this variable is not specified, false is assumed.
  498. #
  499. #
  500. # mklink[svc] = boolean
  501. #
  502. #     Specifies whether or not to create a symbolic link to the created
  503. #     directory (see "mkdir" above) in the actual user's home directory.
  504. #     The name of the link is taken from the "linkname" variable below.
  505. #     For example, if the following were to be specified, and
  506. #     adduser.local were called for the user "mark":
  507. #
  508. #         homedir[data1] = "/data/1"
  509. #         subdir[data1] = "users"
  510. #         althome[data1] = false
  511. #         mkdir[data1] = true
  512. #         mklink[data1] = true
  513. #         linkname[data1] = "data1"
  514. #
  515. #     then, not only would the directory "/data/1/users/mark" be created,
  516. #     but the symbolic link "data1" would be created in his home directory
  517. #     as well, pointing to that directory (that is, "/home/mark/data1" ->
  518. #     "/data/1/users/mark").
  519. #
  520. #     If this variable is not specified, false is assumed.
  521. #
  522. #
  523. # linkname[svc] = path
  524. #
  525. #     Specifies the name of the symbolic link created in the user's home
  526. #     directory, as demonstrated in the example above.  If "path" includes
  527. #     subdirectories, these subdirectories must already exist before the
  528. #     symbolic link is created.
  529. #
  530. #     If the "mklink" variable is true, and the "linkname" variable is not
  531. #     specified, or is an empty string "", the name of the service is used
  532. #     (as specified by the "service" global variable).
  533. #
  534. #
  535. # skelfile[svc] = path
  536. #
  537. #     Instructs adduser.local to copy the file "path" from the "skelother"
  538. #     skeleton directory (see the global variable of that name) into the
  539. #     newly-created directory specified by the "mkdir" variable.  For
  540. #     example, if adduser.local was called for the user "nina", and the
  541. #     following lines were to be specified:
  542. #
  543. #         homedir[www] = "/home/www"
  544. #         subdir[www] = "doc/users"
  545. #         althome[www] = false
  546. #         mkdir[www] = true
  547. #         skelfile[www] = "index.html"
  548. #
  549. #     then the directory "/home/www/doc/users/nina" would be created and
  550. #     the file "index.html" would be copied from /etc/skel.other (or from
  551. #     the directory specified by the "skelother" global variable) into
  552. #     that newly-created directory.
  553. #
  554. #     The newly-copied file will have a mode as specified by the
  555. #     "filemode" global variable, and its group owner will either be the
  556. #     default group of the user, or the group as specified by the "group"
  557. #     variable or implied by the "user" variable.  See the "chgrpskel"
  558. #     variable below.
  559. #
  560. #     If this variable is not specified, or "path" is an empty string "",
  561. #     no file is copied.  If a file of that name already exists, it is NOT
  562. #     overwritten.  Only one file may be specified in any given service;
  563. #     if more are needed, simply create additional services with matching
  564. #     "homedir", "subdir", "althome" and "mkdir" variables.
  565. #
  566. #
  567. # chgrpskel[svc] = boolean
  568. #
  569. #     Determines whether or not adduser.local changes the group owner of
  570. #     the copied skeleton file (specified by the "skelfile" variable
  571. #     above) to the group specified by the "group" variable or implied by
  572. #     the "user" variable.  If this variable is false, the default group
  573. #     of the user remains the group owner.
  574. #
  575. #     If this variable is not specified, false is assumed.
  576. #
  577. #
  578. # End of /etc/adduser.local.conf.
  579.