Debian Codegraph @

upstream/debian-unstable/man8/systemd-sysusers.8

raw
1 '\" t
2 .TH "SYSTEMD\-SYSUSERS" "8" "" "systemd 261~rc3" "systemd-sysusers"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-sysusers, systemd-sysusers.service \- Allocate system users and groups
24 .SH "SYNOPSIS"
25 .HP \w'\fBsystemd\-sysusers\fR\ 'u
26 \fBsystemd\-sysusers\fR [OPTIONS...] [\fICONFIGFILE\fR...]
27 .PP
28 systemd\-sysusers\&.service
29 .SH "DESCRIPTION"
30 .PP
31 \fBsystemd\-sysusers\fR
32 creates system users and groups, based on files in the format described in
33 \fBsysusers.d\fR(5)\&.
34 .PP
35 If invoked with no arguments, directives from the configuration files found in the directories specified by
36 \fBsysusers.d\fR(5)
37 are executed\&. When invoked with positional arguments, if option
38 \fB\-\-replace=\fR\fB\fIPATH\fR\fR
39 is specified, arguments specified on the command line are used instead of the configuration file
40 \fIPATH\fR\&. Otherwise, just the configuration specified by the command line arguments is executed\&. If the string
41 "\-"
42 is specified instead of a filename, the configuration is read from standard input\&. If the argument is a file name (without any slashes), all configuration directories are searched for a matching file and the file found that has the highest priority is executed\&. If the argument is a path, that file is used directly without searching the configuration directories for any other matching file\&.
43 .SH "OPTIONS"
44 .PP
45 The following options are understood:
46 .PP
47 \fB\-\-root=\fR\fB\fIroot\fR\fR
48 .RS 4
49 Takes a directory path as an argument\&. All paths will be prefixed with the given alternate
50 \fIroot\fR
51 path, including config search paths\&.
52 .sp
53 Added in version 215\&.
54 .RE
55 .PP
56 \fB\-\-image=\fR\fB\fIimage\fR\fR
57 .RS 4
58 Takes a path to a disk image file or block device node\&. If specified all operations are applied to file system in the indicated disk image\&. This is similar to
59 \fB\-\-root=\fR
60 but operates on file systems stored in disk images or block devices\&. The disk image should either contain just a file system or a set of file systems within a GPT partition table, following the
61 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. For further information on supported disk images, see
62 \fBsystemd-nspawn\fR(1)\*(Aqs switch of the same name\&.
63 .sp
64 Added in version 247\&.
65 .RE
66 .PP
67 \fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
68 .RS 4
69 Takes an image policy string as argument, as per
70 \fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
71 \fB\-\-image=\fR, see above\&. If not specified, defaults to the
72 "*"
73 policy, i\&.e\&. all recognized file systems in the image are used\&.
74 .RE
75 .PP
76 \fB\-\-replace=\fR\fB\fIPATH\fR\fR
77 .RS 4
78 When this option is given, one or more positional arguments must be specified\&. All configuration files found in the directories listed in
79 \fBsysusers.d\fR(5)
80 will be read, and the configuration given on the command line will be handled instead of and with the same priority as the configuration file
81 \fIPATH\fR\&.
82 .sp
83 This option is intended to be used when package installation scripts are running and files belonging to that package are not yet available on disk, so their contents must be given on the command line, but the admin configuration might already exist and should be given higher priority\&.
84 .PP
85 \fBExample\ \&1.\ \&RPM installation script for radvd\fR
86 .sp
87 .if n \{\
88 .RS 4
89 .\}
90 .nf
91 echo \*(Aqu radvd \- "radvd daemon"\*(Aq | \e
92 systemd\-sysusers \-\-replace=/usr/lib/sysusers\&.d/radvd\&.conf \-
93 .fi
94 .if n \{\
95 .RE
96 .\}
97 .sp
98 This will create the radvd user as if
99 /usr/lib/sysusers\&.d/radvd\&.conf
100 was already on disk\&. An admin might override the configuration specified on the command line by placing
101 /etc/sysusers\&.d/radvd\&.conf
102 or even
103 /etc/sysusers\&.d/00\-overrides\&.conf\&.
104 .sp
105 Note that this is the expanded form, and when used in a package, this would be written using a macro with "radvd" and a file containing the configuration line as arguments\&.
106
107 Added in version 238\&.
108 .RE
109 .PP
110 \fB\-\-dry\-run\fR
111 .RS 4
112 Process the configuration and figure out what entries would be created, but do not actually write anything\&.
113 .sp
114 Added in version 250\&.
115 .RE
116 .PP
117 \fB\-\-inline\fR
118 .RS 4
119 Treat each positional argument as a separate configuration line instead of a file name\&.
120 .sp
121 Added in version 238\&.
122 .RE
123 .PP
124 \fB\-\-cat\-config\fR
125 .RS 4
126 Copy the contents of config files to standard output\&. Before each file, the filename is printed as a comment\&.
127 .RE
128 .PP
129 \fB\-\-tldr\fR
130 .RS 4
131 Copy the contents of config files to standard output\&. Only the "interesting" parts of the configuration files are printed, comments and empty lines are skipped\&. Before each file, the filename is printed as a comment\&.
132 .RE
133 .PP
134 \fB\-\-no\-pager\fR
135 .RS 4
136 Do not pipe output into a pager\&.
137 .RE
138 .PP
139 \fB\-h\fR, \fB\-\-help\fR
140 .RS 4
141 Print a short help text and exit\&.
142 .RE
143 .PP
144 \fB\-\-version\fR
145 .RS 4
146 Print a short version string and exit\&.
147 .RE
148 .SH "CREDENTIALS"
149 .PP
150 \fBsystemd\-sysusers\fR
151 supports the service credentials logic as implemented by
152 \fIImportCredential=\fR/\fILoadCredential=\fR/\fISetCredential=\fR
153 (see
154 \fBsystemd.exec\fR(5)
155 for details)\&. The following credentials are used when passed in:
156 .PP
157 \fIpasswd\&.hashed\-password\&.\fR\fI\fIuser\fR\fR
158 .RS 4
159 A UNIX hashed password string to use for the specified user, when creating an entry for it\&. This is particularly useful for the
160 "root"
161 user as it allows provisioning the default root password to use via a unit file drop\-in or from a container manager passing in this credential\&. Note that setting this credential has no effect if the specified user account already exists\&. This credential is hence primarily useful in first boot scenarios or systems that are fully stateless and come up with an empty
162 /etc/
163 on every boot\&.
164 .sp
165 Added in version 249\&.
166 .RE
167 .PP
168 \fIpasswd\&.plaintext\-password\&.\fR\fI\fIuser\fR\fR
169 .RS 4
170 Similar to
171 "passwd\&.hashed\-password\&.\fIuser\fR"
172 but expect a literal, plaintext password, which is then automatically hashed before used for the user account\&. If both the hashed and the plaintext credential are specified for the same user the former takes precedence\&. It\*(Aqs generally recommended to specify the hashed version; however in test environments with weaker requirements on security it might be easier to pass passwords in plaintext instead\&.
173 .sp
174 Added in version 249\&.
175 .RE
176 .PP
177 \fIpasswd\&.shell\&.\fR\fI\fIuser\fR\fR
178 .RS 4
179 Specifies the shell binary to use for the specified account when creating it\&.
180 .sp
181 Added in version 249\&.
182 .RE
183 .PP
184 \fIsysusers\&.extra\fR
185 .RS 4
186 The contents of this credential may contain additional lines to operate on\&. The credential contents should follow the same format as any other
187 sysusers\&.d/
188 drop\-in\&. If this credential is passed it is processed after all of the drop\-in files read from the file system\&.
189 .sp
190 Added in version 252\&.
191 .RE
192 .PP
193 Note that by default the
194 systemd\-sysusers\&.service
195 unit file is set up to inherit the
196 "passwd\&.hashed\-password\&.root",
197 "passwd\&.plaintext\-password\&.root",
198 "passwd\&.shell\&.root"
199 and
200 "sysusers\&.extra"
201 credentials from the service manager\&. Thus, when invoking a container with an unpopulated
202 /etc/
203 for the first time it is possible to configure the root user\*(Aqs password to be
204 "systemd"
205 like this:
206 .PP
207 .if n \{\
208 .RS 4
209 .\}
210 .nf
211 # systemd\-nspawn \-\-image=\&... \-\-set\-credential=passwd\&.hashed\-password\&.root:\*(Aq$y$j9T$yAuRJu1o5HioZAGDYPU5d\&.$F64ni6J2y2nNQve90M/p0ZP0ECP/qqzipNyaY9fjGpC\*(Aq \&...
212 .fi
213 .if n \{\
214 .RE
215 .\}
216 .PP
217 Note again that the data specified in this credential is consulted only when creating an account for the first time, it may not be used for changing the password or shell of an account that already exists\&.
218 .PP
219 Use
220 \fBmkpasswd\fR(1)
221 for generating UNIX password hashes from the command line\&.
222 .SH "EXIT STATUS"
223 .PP
224 On success, 0 is returned, a non\-zero failure code otherwise\&.
225 .SH "SEE ALSO"
226 .PP
227 \fBsystemd\fR(1), \fBsysusers.d\fR(5), \m[blue]\fBUsers, Groups, UIDs and GIDs on systemd systems\fR\m[]\&\s-2\u[2]\d\s+2, \fBsystemd.exec\fR(5), \fBmkpasswd\fR(1)
228 .SH "NOTES"
229 .IP " 1." 4
230 UAPI.2 Discoverable Partitions Specification
231 .RS 4
232 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
233 .RE
234 .IP " 2." 4
235 Users, Groups, UIDs and GIDs on systemd systems
236 .RS 4
237 \%https://systemd.io/UIDS-GIDS
238 .RE