makeusers-syntax.txt 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // -*- mode:doc -*- ;
  2. [[makeuser-syntax]]
  3. == Makeuser syntax documentation
  4. The syntax to create users is inspired by the makedev syntax, above, but
  5. is specific to Buildroot.
  6. The syntax for adding a user is a space-separated list of fields, one
  7. user per line; the fields are:
  8. |=================================================================
  9. |username |uid |group |gid |password |home |shell |groups |comment
  10. |=================================================================
  11. Where:
  12. - +username+ is the desired user name (aka login name) for the user.
  13. It can not be +root+, and must be unique.
  14. - +uid+ is the desired UID for the user. It must be unique, and not
  15. +0+. If set to +-1+, then a unique UID will be computed by Buildroot
  16. in the range [1000...1999]
  17. - +group+ is the desired name for the user's main group. It can not
  18. be +root+. If the group does not exist, it will be created.
  19. - +gid+ is the desired GID for the user's main group. It must be unique,
  20. and not +0+. If set to +-1+, and the group does not already exist, then
  21. a unique GID will be computed by Buildroot in the range [1000..1999]
  22. - +password+ is the crypt(3)-encoded password. If prefixed with +!+,
  23. then login is disabled. If prefixed with +=+, then it is interpreted
  24. as clear-text, and will be crypt-encoded (using MD5). If prefixed with
  25. +!=+, then the password will be crypt-encoded (using MD5) and login
  26. will be disabled. If set to +*+, then login is not allowed.
  27. - +home+ is the desired home directory for the user. If set to '-', no
  28. home directory will be created, and the user's home will be +/+.
  29. Explicitly setting +home+ to +/+ is not allowed.
  30. - +shell+ is the desired shell for the user. If set to +-+, then
  31. +/bin/false+ is set as the user's shell.
  32. - +groups+ is the comma-separated list of additional groups the user
  33. should be part of. If set to +-+, then the user will be a member of
  34. no additional group. Missing groups will be created with an arbitrary
  35. +gid+.
  36. - +comment+ (aka https://en.wikipedia.org/wiki/Gecos_field[GECOS]
  37. field) is an almost-free-form text.
  38. There are a few restrictions on the content of each field:
  39. * except for +comment+, all fields are mandatory.
  40. * except for +comment+, fields may not contain spaces.
  41. * no field may contain a colon (+:+).
  42. If +home+ is not +-+, then the home directory, and all files below,
  43. will belong to the user and its main group.
  44. Examples:
  45. ----
  46. foo -1 bar -1 !=blabla /home/foo /bin/sh alpha,bravo Foo user
  47. ----
  48. This will create this user:
  49. - +username+ (aka login name) is: +foo+
  50. - +uid+ is computed by Buildroot
  51. - main +group+ is: +bar+
  52. - main group +gid+ is computed by Buildroot
  53. - clear-text +password+ is: +blabla+, will be crypt(3)-encoded, and login is disabled.
  54. - +home+ is: +/home/foo+
  55. - +shell+ is: +/bin/sh+
  56. - +foo+ is also a member of +groups+: +alpha+ and +bravo+
  57. - +comment+ is: +Foo user+
  58. ----
  59. test 8000 wheel -1 = - /bin/sh - Test user
  60. ----
  61. This will create this user:
  62. - +username+ (aka login name) is: +test+
  63. - +uid+ is : +8000+
  64. - main +group+ is: +wheel+
  65. - main group +gid+ is computed by Buildroot, and will use the value defined in the rootfs skeleton
  66. - +password+ is empty (aka no password).
  67. - +home+ is +/+ but will not belong to +test+
  68. - +shell+ is: +/bin/sh+
  69. - +test+ is not a member of any additional +groups+
  70. - +comment+ is: +Test user+