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