3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5 This file is part of systemd.
7 Copyright 2014 Lennart Poettering
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 <refentry id="sysusers.d">
25 <title>sysusers.d</title>
26 <productname>systemd</productname>
30 <contrib>Developer</contrib>
31 <firstname>Lennart</firstname>
32 <surname>Poettering</surname>
33 <email>lennart@poettering.net</email>
39 <refentrytitle>sysusers.d</refentrytitle>
40 <manvolnum>5</manvolnum>
44 <refname>sysusers.d</refname>
45 <refpurpose>Declarative allocation of system users and groups</refpurpose>
49 <para><filename>/usr/lib/sysusers.d/*.conf</filename></para>
53 <title>Description</title>
55 <para><command>systemd-sysusers</command> uses the
56 files from <filename>/usr/lib/sysusers.d/</filename>
57 to create system users and groups at package
58 installation or boot time. This tool may be used for
59 allocating system users and groups only, it is not
60 useful for creating non-system users and groups, as it
61 accessed <filename>/etc/passwd</filename> and
62 <filename>/etc/group</filename> directly, bypassing
63 any more complex user database, for example any
64 database involving NIS or LDAP.</para>
69 <title>File Format</title>
71 <para>Each file shall be named in the style of
72 <filename><replaceable>package</replaceable>.conf</filename>.</para>
74 <para>All files are sorted by their filename in
75 lexicographic order, regardless of which of the
76 directories they reside in. If multiple files specify
77 the same user or group, the entry in the file with the
78 lexicographically earliest name will be applied, all
79 all other conflicting entries will be logged as
80 errors. Users and groups are
81 processed in the order they are listed.</para>
83 <para>The file format is one line per user or group
84 containing name, ID and GECOS field description:</para>
86 <programlisting># Type Name ID GECOS
87 u httpd 440 "HTTP User"
88 u authd /usr/bin/authd "Authorization user"
89 g input - -</programlisting>
94 <para>The type consists of a single
95 letter. The following line types are
100 <term><varname>u</varname></term>
101 <listitem><para>Create a
102 system user and group of the
103 specified name should they not
104 exist yet. The user's primary
105 group will be set to the group
106 bearing the same name. The
107 user's shell will be set to
108 <filename>/sbin/login</filename>,
109 the home directory to
110 <filename>/</filename>. The
111 account will be created
112 disabled, so that logins are
113 not allowed.</para></listitem>
117 <term><varname>g</varname></term>
118 <listitem><para>Create a
119 system group of the specified
120 name should it not exist
123 implicitly create a matching
124 group. The group will be
125 created with no password
126 set.</para></listitem>
134 <para>The name field specifies the user or
135 group name. It should be be shorter than 256
136 characters and avoid any non-ASCII characters,
137 and not begin with a numeric character. It is
138 strongly recommended to pick user and group
139 names that are unlikely to clash with normal
140 users created by the administrator. A good
141 scheme to guarantee this is by prefixing all
142 system and group names with the underscore,
143 and avoiding too generic names.</para>
149 <para>The numeric 32bit UID or GID of the
150 user/group. Do not use IDs 65535 or
151 4294967295, as they have special placeholder
152 meanings. Specify "-" for automatic UID/GID
153 allocation for the user or
154 group. Alternatively, specify an absolute path
155 in the file system. In this case the UID/GID
156 is read from the path's owner/group. This is
157 useful to create users whose UID/GID match the
158 owners of pre-existing files (such as SUID or
159 SGID binaries).</para>
165 <para>A short, descriptive string for users to
166 be created, enclosed in quotation marks. Note
167 that this field may not contain colons.</para>
173 <title>See Also</title>
175 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>systemd-sysusers</refentrytitle><manvolnum>8</manvolnum></citerefentry>