Debian Codegraph @

upstream/debian-unstable/man1/homectl.1

raw
1 '\" t
2 .TH "HOMECTL" "1" "" "systemd 261~rc3" "homectl"
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 homectl, systemd-homed-firstboot.service \- Create, remove, change or inspect home directories
24 .SH "SYNOPSIS"
25 .HP \w'\fBhomectl\fR\ 'u
26 \fBhomectl\fR [OPTIONS...] {COMMAND} [NAME...]
27 .SH "DESCRIPTION"
28 .PP
29 \fBhomectl\fR
30 may be used to create, remove, change or inspect a user\*(Aqs home directory\&. It\*(Aqs primarily a command interfacing with
31 \fBsystemd-homed.service\fR(8)
32 which manages home directories of users\&.
33 .PP
34 Home directories managed by
35 systemd\-homed\&.service
36 are self\-contained, and thus include the user\*(Aqs full metadata record in the home\*(Aqs data storage itself, making them easy to migrate between machines\&. In particular, a home directory describes a matching user record, and every user record managed by
37 systemd\-homed\&.service
38 also implies existence and encapsulation of a home directory\&. The user account and home directory become the same concept\&.
39 .PP
40 The following backing storage mechanisms are supported:
41 .sp
42 .RS 4
43 .ie n \{\
44 \h'-04'\(bu\h'+03'\c
45 .\}
46 .el \{\
47 .sp -1
48 .IP \(bu 2.3
49 .\}
50 An individual LUKS2 encrypted loopback file for a user, stored in
51 /home/*\&.home\&. At login the file system contained in this files is mounted, after the LUKS2 encrypted volume has been attached\&. The user\*(Aqs password is identical to the encryption passphrase of the LUKS2 volume\&. Access to data without preceding user authentication is thus not possible, even for the system administrator\&. This storage mechanism provides the strongest data security and is thus recommended\&.
52 .RE
53 .sp
54 .RS 4
55 .ie n \{\
56 \h'-04'\(bu\h'+03'\c
57 .\}
58 .el \{\
59 .sp -1
60 .IP \(bu 2.3
61 .\}
62 Similar, but the LUKS2 encrypted file system is located on regular block device, such as a USB storage stick\&. In this mode home directories and all data they include are nicely migratable between machines, simply by plugging the USB stick into different systems at different times\&.
63 .RE
64 .sp
65 .RS 4
66 .ie n \{\
67 \h'-04'\(bu\h'+03'\c
68 .\}
69 .el \{\
70 .sp -1
71 .IP \(bu 2.3
72 .\}
73 An encrypted directory using
74 "fscrypt"
75 on file systems that support it (at the moment this is primarily
76 "ext4"), located in
77 /home/*\&.homedir\&. This mechanism also provides encryption, but substantially weaker than LUKS2, as most file system metadata is unprotected\&. Moreover it currently does not support changing user passwords once the home directory has been created\&.
78 .RE
79 .sp
80 .RS 4
81 .ie n \{\
82 \h'-04'\(bu\h'+03'\c
83 .\}
84 .el \{\
85 .sp -1
86 .IP \(bu 2.3
87 .\}
88 A
89 "btrfs"
90 subvolume for each user, also located in
91 /home/*\&.homedir\&. This provides no encryption, but good quota support\&.
92 .RE
93 .sp
94 .RS 4
95 .ie n \{\
96 \h'-04'\(bu\h'+03'\c
97 .\}
98 .el \{\
99 .sp -1
100 .IP \(bu 2.3
101 .\}
102 A regular directory for each user, also located in
103 /home/*\&.homedir\&. This provides no encryption, but is a suitable fallback available on all machines, even where LUKS2,
104 "fscrypt"
105 or
106 "btrfs"
107 support is not available\&.
108 .RE
109 .sp
110 .RS 4
111 .ie n \{\
112 \h'-04'\(bu\h'+03'\c
113 .\}
114 .el \{\
115 .sp -1
116 .IP \(bu 2.3
117 .\}
118 An individual Windows file share (CIFS) for each user\&.
119 .RE
120 .PP
121 Note that
122 systemd\-homed\&.service
123 and
124 \fBhomectl\fR
125 will not manage "classic" UNIX user accounts as created with
126 \fBuseradd\fR(8)
127 or similar tools\&. In particular, this functionality is not suitable for managing system users (i\&.e\&. users with a UID below 1000) but is exclusive to regular ("human") users\&.
128 .PP
129 Note that users/home directories managed via
130 \fBsystemd\-homed\&.service\fR
131 do not show up in
132 /etc/passwd
133 and similar files, they are synthesized via glibc NSS during runtime\&. They are thus resolvable and may be enumerated via the
134 \fBgetent\fR(1)
135 tool\&.
136 .PP
137 This tool interfaces directly with
138 systemd\-homed\&.service, and may execute specific commands on the home directories it manages\&. Since every home directory managed that way also defines a JSON user and group record these home directories may also be inspected and enumerated via
139 \fBuserdbctl\fR(1)\&.
140 .PP
141 Home directories managed by
142 systemd\-homed\&.service
143 are usually in one of two states, or in a transition state between them: when
144 "active"
145 they are unlocked and mounted, and thus accessible to the system and its programs; when
146 "inactive"
147 they are not mounted and thus not accessible\&. Activation happens automatically at login of the user and usually can only complete after a password (or other authentication token) has been supplied\&. Deactivation happens after the user fully logged out\&. A home directory remains active as long as the user is logged in at least once, i\&.e\&. has at least one login session\&. When the user logs in a second time simultaneously the home directory remains active\&. It is deactivated only after the last of the user\*(Aqs sessions ends\&.
148 .SH "OPTIONS"
149 .PP
150 The following general options are understood (further options that control the various properties of user records managed by
151 systemd\-homed\&.service
152 are documented further down):
153 .PP
154 \fB\-\-identity=\fR\fB\fIFILE\fR\fR
155 .RS 4
156 Read the user\*(Aqs JSON record from the specified file\&. If passed as
157 "\-"
158 read the user record from standard input\&. The supplied JSON object must follow the structure documented in
159 \m[blue]\fBJSON User Records\fR\m[]\&\s-2\u[1]\d\s+2\&. This option may be used in conjunction with the
160 \fBcreate\fR
161 and
162 \fBupdate\fR
163 commands (see below), where it allows configuring the user record in JSON as\-is, instead of setting the individual user record properties (see below)\&.
164 .sp
165 Added in version 245\&.
166 .RE
167 .PP
168 \fB\-\-json=\fR\fB\fIFORMAT\fR\fR, \fB\-j\fR
169 .RS 4
170 Controls whether to output the user record in JSON format, if the
171 \fBinspect\fR
172 command (see below) is used\&. Takes one of
173 "pretty",
174 "short"
175 or
176 "off"\&. If
177 "pretty"
178 human\-friendly whitespace and newlines are inserted in the output to make the JSON data more readable\&. If
179 "short"
180 all superfluous whitespace is suppressed\&. If
181 "off"
182 (the default) the user information is not shown in JSON format but in a friendly human\-readable formatting instead\&. The
183 \fB\-j\fR
184 option picks
185 "pretty"
186 when run interactively and
187 "short"
188 otherwise\&.
189 .sp
190 Added in version 245\&.
191 .RE
192 .PP
193 \fB\-\-export\-format=\fR\fB\fIFORMAT\fR\fR, \fB\-E\fR, \fB\-EE\fR
194 .RS 4
195 When used with the
196 \fBinspect\fR
197 verb in JSON mode (see above) may be used to suppress certain aspects of the JSON user record on output\&. Specifically, if
198 "stripped"
199 format is used the binding and runtime fields of the record are removed\&. If
200 "minimal"
201 format is used the cryptographic signature is removed too\&. If
202 "full"
203 format is used the full JSON record is shown (this is the default)\&. This option is useful for copying an existing user record to a different system in order to create a similar user there with the same settings\&. Specifically:
204 \fBhomectl inspect \-EE | ssh root@othersystem homectl create \-i\-\fR
205 may be used as simple command line for replicating a user on another host\&.
206 \fB\-E\fR
207 is equivalent to
208 \fB\-j \-\-export\-format=stripped\fR,
209 \fB\-EE\fR
210 to
211 \fB\-j \-\-export\-format=minimal\fR\&. Note that when replicating user accounts user records acquired in
212 "stripped"
213 mode will retain the original cryptographic signatures and thus may only be modified when the private key to update them is available on the destination machine\&. When replicating users in
214 "minimal"
215 mode, the signature is removed during the replication and thus the record will be implicitly signed with the key of the destination machine and may be updated there without any private key replication\&.
216 .sp
217 Added in version 245\&.
218 .RE
219 .PP
220 \fB\-\-offline\fR
221 .RS 4
222 Do not attempt to update the copy of the user record and blob directory that is embedded inside of the home area\&. This allows for operation on home areas that are absent, or without needing to authenticate as the user being modified\&.
223 .sp
224 Added in version 256\&.
225 .RE
226 .PP
227 \fB\-\-key\-name=\fR
228 .RS 4
229 When used with the
230 \fBadd\-signing\-key\fR
231 command, specify or override the name under which to store the public key being added\&. The specified name can be chosen freely, but must be suffixed with
232 "\&.public"\&. If this option is not used the name is derived from the specified filename\&. If a key is read from standard input this option is mandatory in order to provide a suitable name for the key being added\&.
233 .sp
234 Added in version 258\&.
235 .RE
236 .PP
237 \fB\-\-seize=\fR
238 .RS 4
239 Takes a boolean argument\&. When used with
240 \fBcreate\fR
241 or
242 \fBregister\fR, controls whether to strip cryptographic signatures from the provided JSON user records, which has the effect of signing them with the local signing key (local\&.public) instead\&. If this switch is set to true, added user records hence become locally managed (and thus can be modified locally), while if it is set to false the user records remain managed and owned by its origin (and thus cannot be modified locally)\&. This switch defaults to true for
243 \fBcreate\fR
244 and false for
245 \fBregister\fR\&.
246 .sp
247 Added in version 258\&.
248 .RE
249 .PP
250 \fB\-\-prompt\-new\-user\fR
251 .RS 4
252 If used in conjunction with
253 \fBfirstboot\fR
254 and no regular user account exists on the system so far the tool will interactively query for user information and create an account\&.
255 .sp
256 Added in version 256\&.
257 .RE
258 .PP
259 \fB\-\-prompt\-shell=\fR
260 .RS 4
261 Takes a boolean argument\&. Controls whether to interactively query for a login shell, if
262 \fBfirstboot \-\-prompt\-new\-user\fR
263 is used\&. Defaults to true\&.
264 .sp
265 Added in version 259\&.
266 .RE
267 .PP
268 \fB\-\-prompt\-groups=\fR
269 .RS 4
270 Takes a boolean argument\&. Controls whether to interactively query for auxiliary groups to add the new user to, if
271 \fBfirstboot \-\-prompt\-new\-user\fR
272 is used\&. Defaults to true\&.
273 .sp
274 Added in version 259\&.
275 .RE
276 .PP
277 \fB\-\-chrome=\fR
278 .RS 4
279 Takes a boolean argument\&. By default the interactive user creation via
280 \fBfirstboot \-\-prompt\-new\-user\fR
281 screen will show reverse color "chrome" bars at the top and and the bottom of the terminal screen, which may be disabled by setting this option to false\&.
282 .sp
283 Added in version 259\&.
284 .RE
285 .PP
286 \fB\-\-mute\-console=\fR
287 .RS 4
288 Takes a boolean argument\&. If true kernel log output and service manager status output to the system console is temporarily disabled while
289 \fBfirstboot \-\-prompt\-new\-user\fR
290 is running, so that its own output is not interrupted\&. Defaults to false\&.
291 .sp
292 Added in version 259\&.
293 .RE
294 .PP
295 \fB\-\-match=this|other|any|auto\fR, \fB\-A\fR, \fB\-N\fR, \fB\-T\fR
296 .RS 4
297 Option
298 \fB\-\-match=\fR
299 takes one of
300 "this",
301 "other",
302 "any"
303 or
304 "auto"\&. Some user record settings can be defined to match only specific machines, or all machines but one, or all machines\&. With this switch it is possibly to control to which machines to apply the settings appearing on the command line after it\&. If
305 "this"
306 is specified the setting will only apply to the local system (positive match), if
307 "other"
308 it will apply to all but the local system (negative match), if
309 "any"
310 it will apply to all systems (unless there\*(Aqs a matching positive or negative per\-machine setting)\&. If
311 "auto"
312 returns to the default logic: whether a setting applies by default to the local system or all systems depends on the option in question\&.
313 .sp
314 Note that only some user record settings can be conditioned like this\&. This option has no effect on the others and is ignored there\&. This option may appear multiple times in a single command line to apply settings conditioned by different matches to the same user record\&. See
315 \m[blue]\fBJSON User Records\fR\m[]\&\s-2\u[1]\d\s+2
316 for details on which settings may be used with such per\-machine matching and which ones may not\&.
317 .sp
318 \fB\-A\fR
319 is a shortcut for
320 \fB\-\-match=any\fR,
321 \fB\-T\fR
322 is short for
323 \fB\-\-match=this\fR
324 and
325 \fB\-N\fR
326 is short for
327 \fB\-\-match=other\fR\&.
328 .sp
329 Here\*(Aqs an example call that sets the storage field to
330 "luks"
331 on the local system, but to
332 "cifs"
333 on all others:
334 .sp
335 .if n \{\
336 .RS 4
337 .\}
338 .nf
339 # homectl update lennart \-T \-\-storage=luks \-N \-\-storage=cifs
340 .fi
341 .if n \{\
342 .RE
343 .\}
344 .sp
345 Added in version 258\&.
346 .RE
347 .PP
348 \fB\-H\fR, \fB\-\-host=\fR
349 .RS 4
350 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
351 "@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
352 ":", and then a container name, separated by
353 "/", which connects directly to a specific container on the specified host\&. This will use SSH to talk to the remote machine manager instance\&. Container names may be enumerated with
354 \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
355 .RE
356 .PP
357 \fB\-M\fR, \fB\-\-machine=\fR
358 .RS 4
359 Execute operation on a local container\&. Specify a container name to connect to, optionally prefixed by a user name to connect as and a separating
360 "@"
361 character\&. If the special string
362 "\&.host"
363 is used in place of the container name, a connection to the local system is made (which is useful to connect to a specific user\*(Aqs user bus:
364 "\-\-user \-\-machine=lennart@\&.host")\&. If the
365 "@"
366 syntax is not used, the connection is made as root user\&. If the
367 "@"
368 syntax is used either the left hand side or the right hand side may be omitted (but not both) in which case the local user name and
369 "\&.host"
370 are implied\&.
371 .RE
372 .PP
373 \fB\-\-no\-pager\fR
374 .RS 4
375 Do not pipe output into a pager\&.
376 .RE
377 .PP
378 \fB\-\-no\-legend\fR
379 .RS 4
380 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
381 .RE
382 .PP
383 \fB\-\-no\-ask\-password\fR
384 .RS 4
385 Do not query the user for authentication for privileged operations\&.
386 .RE
387 .PP
388 \fB\-h\fR, \fB\-\-help\fR
389 .RS 4
390 Print a short help text and exit\&.
391 .RE
392 .PP
393 \fB\-\-version\fR
394 .RS 4
395 Print a short version string and exit\&.
396 .RE
397 .SH "GENERAL USER RECORD PROPERTIES"
398 .PP
399 The following options control various properties of the user records/home directories that
400 systemd\-homed\&.service
401 manages\&. These switches may be used in conjunction with the
402 \fBcreate\fR
403 and
404 \fBupdate\fR
405 commands for configuring various aspects of the home directory and the user account:
406 .PP
407 \fB\-\-real\-name=\fR\fB\fINAME\fR\fR, \fB\-c\fR \fINAME\fR
408 .RS 4
409 The real name for the user\&. This corresponds with the GECOS field on classic UNIX NSS records\&.
410 .sp
411 Added in version 245\&.
412 .RE
413 .PP
414 \fB\-\-realm=\fR\fB\fIREALM\fR\fR
415 .RS 4
416 The realm for the user\&. The realm associates a user with a specific organization or installation, and allows distinguishing users of the same name defined in different contexts\&. The realm can be any string that also qualifies as valid DNS domain name, and it is recommended to use the organization\*(Aqs or installation\*(Aqs domain name for this purpose, but this is not enforced nor required\&. On each system only a single user of the same name may exist, and if a user with the same name and realm is seen it is assumed to refer to the same user while a user with the same name but different realm is considered a different user\&. Note that this means that two users sharing the same name but with distinct realms are not allowed on the same system\&. Assigning a realm to a user is optional\&.
417 .sp
418 Added in version 245\&.
419 .RE
420 .PP
421 \fB\-\-alias=\fR\fB\fINAME\fR\fR\fB[,\fINAME\&...\fR]\fR
422 .RS 4
423 Additional names for the user\&. Takes one or more valid UNIX user names, separated by commas\&. May be used multiple times to define multiple aliases\&. An alias username may be specified wherever the primary user name may be specified, and resolves to the same user record\&.
424 .sp
425 Added in version 258\&.
426 .RE
427 .PP
428 \fB\-\-email\-address=\fR\fB\fIEMAIL\fR\fR
429 .RS 4
430 Takes an electronic mail address to associate with the user\&. On log\-in the
431 \fI$EMAIL\fR
432 environment variable is initialized from this value\&.
433 .sp
434 Added in version 245\&.
435 .RE
436 .PP
437 \fB\-\-location=\fR\fB\fITEXT\fR\fR
438 .RS 4
439 Takes location specification for this user\&. This is free\-form text, which might or might not be usable by geo\-location applications\&. Example:
440 \fB\-\-location="Berlin, Germany"\fR
441 or
442 \fB\-\-location="Basement, Room 3a"\fR
443 .sp
444 Added in version 245\&.
445 .RE
446 .PP
447 \fB\-\-birth\-date=\fR\fB[\fIDATE\fR]\fR
448 .RS 4
449 Takes a birth date for the user in ISO 8601 calendar date format ("YYYY\-MM\-DD")\&. The earliest representable year is 1900\&. If an empty string is passed the birth date is reset to unset\&.
450 .sp
451 Added in version 261\&.
452 .RE
453 .PP
454 \fB\-\-icon\-name=\fR\fB\fIICON\fR\fR
455 .RS 4
456 Takes an icon name to associate with the user, following the scheme defined by the
457 \m[blue]\fBIcon Naming Specification\fR\m[]\&\s-2\u[2]\d\s+2\&.
458 .sp
459 Added in version 245\&.
460 .RE
461 .PP
462 \fB\-\-home\-dir=\fR\fB\fIPATH\fR\fR, \fB\-d\fR\fB\fIPATH\fR\fR
463 .RS 4
464 Takes a path to use as home directory for the user\&. Note that this is the directory the user\*(Aqs home directory is mounted to while the user is logged in\&. This is not where the user\*(Aqs data is actually stored, see
465 \fB\-\-image\-path=\fR
466 for that\&. If not specified, defaults to
467 /home/$USER\&.
468 .sp
469 Added in version 245\&.
470 .RE
471 .PP
472 \fB\-\-uid=\fR\fB\fIUID\fR\fR
473 .RS 4
474 Takes a preferred numeric UNIX UID to assign this user\&. If a user is to be created with the specified UID and it is already taken by a different user on the local system then creation of the home directory is refused\&. Note though, if after creating the home directory it is used on a different system and the configured UID is taken by another user there, then
475 \fBsystemd\-homed\fR
476 may assign the user a different UID on that system\&. The specified UID must be outside of the system user range\&. It is recommended to use the 60001\&...60513 UID range for this purpose\&. If not specified, the UID is automatically picked\&. If the home directory is found to be owned by a different UID when logging in, the home directory and everything underneath it will have its ownership changed automatically before login completes\&.
477 .sp
478 Note that changing this option for existing home directories generally has no effect on home directories that already have been registered locally (have a local
479 \fIbinding\fR), as the UID used for an account on the local system is determined when the home directory is first activated on it, and then remains in effect until the home directory is removed\&.
480 .sp
481 Note that users managed by
482 \fBsystemd\-homed\fR
483 always have a matching group associated with the same name as well as a GID matching the UID of the user\&. Thus, configuring the GID separately is not permitted\&.
484 .sp
485 Added in version 245\&.
486 .RE
487 .PP
488 \fB\-\-member\-of=\fR\fB\fIGROUP\fR\fR, \fB\-G\fR \fIGROUP\fR
489 .RS 4
490 Takes a comma\-separated list of auxiliary UNIX groups this user shall belong to\&. Example:
491 \fB\-\-member\-of=wheel\fR
492 to provide the user with administrator privileges\&. Note that
493 \fBsystemd\-homed\fR
494 does not manage any groups besides a group matching the user in name and numeric UID/GID\&. Thus any groups listed here must be registered independently, for example with
495 \fBgroupadd\fR(8)\&. Any non\-existent groups are ignored\&. This option may be used more than once, in which case all specified group lists are combined\&. If the user is currently a member of a group which is not listed, the user will be removed from the group\&.
496 .sp
497 Added in version 245\&.
498 .RE
499 .PP
500 \fB\-\-capability\-bounding\-set=\fR\fB\fICAPABILITIES\fR\fR, \fB\-\-capability\-ambient\-set=\fR\fB\fICAPABILITIES\fR\fR
501 .RS 4
502 These options take a space separated list of process capabilities (e\&.g\&.
503 \fBCAP_WAKE_ALARM\fR,
504 \fBCAP_BLOCK_SUSPEND\fR, \&...) that shall be set in the capability bounding and ambient sets for all the user\*(Aqs sessions\&. See
505 \fBcapabilities\fR(7)
506 for details on the capabilities concept\&. These options may be used more than once, in which case the specified lists are combined\&. If the parameter begins with a
507 "~"
508 character the effect is inverted: the specified capability is dropped from the specific set\&.
509 .sp
510 Added in version 254\&.
511 .RE
512 .PP
513 \fB\-\-access\-mode=\fR\fB\fIMODE\fR\fR
514 .RS 4
515 Takes a UNIX file access mode written in octal\&. Configures the access mode of the home directory itself\&. Note that this is only used when the directory is first created, and the user may change this any time afterwards\&. Example:
516 \fB\-\-access\-mode=0700\fR
517 .sp
518 Added in version 245\&.
519 .RE
520 .PP
521 \fB\-\-umask=\fR\fB\fIMASK\fR\fR
522 .RS 4
523 Takes the access mode mask (in octal syntax) to apply to newly created files and directories of the user ("umask")\&. If set this controls the initial umask set for all login sessions of the user, possibly overriding the system\*(Aqs defaults\&.
524 .sp
525 Added in version 245\&.
526 .RE
527 .PP
528 \fB\-\-skel=\fR\fB\fIPATH\fR\fR
529 .RS 4
530 Takes a file system path to a directory\&. Specifies the skeleton directory to initialize the home directory with\&. All files and directories in the specified path are copied into any newly create home directory\&. If not specified, defaults to
531 /etc/skel/\&.
532 .sp
533 Added in version 245\&.
534 .RE
535 .PP
536 \fB\-\-shell=\fR\fB\fISHELL\fR\fR
537 .RS 4
538 Takes a file system path\&. Specifies the shell binary to execute on terminal logins\&. If not specified, defaults to
539 /bin/bash\&.
540 .sp
541 Added in version 245\&.
542 .RE
543 .PP
544 \fB\-\-setenv=\fR\fB\fIVARIABLE\fR\fR\fB[=\fR\fB\fIVALUE\fR\fR\fB]\fR
545 .RS 4
546 Takes an environment variable assignment to set for all user processes\&. May be used multiple times to set multiple environment variables\&. When
547 "="
548 and
549 \fIVALUE\fR
550 are omitted, the value of the variable with the same name in the program environment will be used\&.
551 .sp
552 Note that a number of other settings also result in environment variables to be set for the user, including
553 \fB\-\-email=\fR,
554 \fB\-\-timezone=\fR
555 and
556 \fB\-\-language=\fR\&.
557 .sp
558 Added in version 245\&.
559 .RE
560 .PP
561 \fB\-\-timezone=\fR\fB\fITIMEZONE\fR\fR
562 .RS 4
563 Takes a time zone location name that sets the timezone for the specified user\&. When the user logs in the
564 \fI$TZ\fR
565 environment variable is initialized from this setting\&. Example:
566 \fB\-\-timezone=Europe/Amsterdam\fR
567 will result in the environment variable
568 "TZ=:Europe/Amsterdam"\&. (":"
569 is used intentionally as part of the timezone specification, see
570 \fBtzset\fR(3)\&.)
571 .sp
572 Added in version 245\&.
573 .RE
574 .PP
575 \fB\-\-language=\fR\fB\fILANG\fR\fR
576 .RS 4
577 Takes a comma\- or colon\-separated list of languages preferred by the user, ordered by descending priority\&. The
578 \fI$LANG\fR
579 and
580 \fI$LANGUAGE\fR
581 environment variables are initialized from this value on login, and thus values suitable for these environment variables are accepted here, for example
582 \fB\-\-language=de_DE\&.UTF\-8\fR\&. This option may be used more than once, in which case the language lists are concatenated\&.
583 .sp
584 Added in version 245\&.
585 .RE
586 .PP
587 \fB\-\-default\-area=\fR\fB\fIAREA\fR\fR
588 .RS 4
589 Takes a string identifying a home directory "area" to use as default\&. Areas are secondary home directories within the primary home directory of a user\&. When logging in a user can specify the area they wish to log into, which ensures that the
590 \fI$HOME\fR
591 environment variable is set to
592 ~/Areas/
593 suffixed by the area name\&.
594 .sp
595 For details on the area concept see
596 \fBpam_systemd_home\fR(8)\&. Note that this option just defines the default, which can be overridden at login time\&.
597 .sp
598 When this option is specified with an empty string as value any previously declared default area is removed from the user record\&.
599 .sp
600 Added in version 258\&.
601 .RE
602 .SH "AUTHENTICATION USER RECORD PROPERTIES"
603 .PP
604 \fB\-\-ssh\-authorized\-keys=\fR\fB\fIKEYS\fR\fR
605 .RS 4
606 Either takes a SSH authorized key line to associate with the user record or a
607 "@"
608 character followed by a path to a file to read one or more such lines from\&. SSH keys configured this way are made available to SSH to permit access to this home directory and user record\&. This option may be used more than once to configure multiple SSH keys\&.
609 .sp
610 Added in version 245\&.
611 .RE
612 .PP
613 \fB\-\-pkcs11\-token\-uri=\fR\fB\fIURI\fR\fR
614 .RS 4
615 Takes an RFC 7512 PKCS#11 URI referencing a security token (e\&.g\&. YubiKey or PIV smartcard) that shall be able to unlock the user account\&. The security token URI should reference a security token with exactly one pair of X\&.509 certificate and private key\&. A random secret key is then generated, encrypted with the public key of the X\&.509 certificate, and stored as part of the user record\&. At login time it is decrypted with the PKCS#11 module and then used to unlock the account and associated resources\&. See below for an example how to set up authentication with a security token\&.
616 .sp
617 Instead of a valid PKCS#11 URI, the special strings
618 "list"
619 and
620 "auto"
621 may be specified\&. If
622 "list"
623 is passed, a brief table of suitable, currently plugged in PKCS#11 hardware tokens is shown, along with their URIs\&. If
624 "auto"
625 is passed, a suitable PKCS#11 hardware token is automatically selected (this operation will fail if there isn\*(Aqt exactly one suitable token discovered)\&. The latter is a useful shortcut for the most common case where a single PKCS#11 hardware token is plugged in\&.
626 .sp
627 Note that many hardware security tokens implement both PKCS#11/PIV and FIDO2 with the
628 "hmac\-secret"
629 extension (for example: the YubiKey 5 series), as supported with the
630 \fB\-\-fido2\-device=\fR
631 option below\&. Both mechanisms are similarly powerful, though FIDO2 is the more modern technology\&. PKCS#11/PIV tokens have the benefit of being recognizable before authentication and hence can be used for implying the user identity to use for logging in, which FIDO2 does not allow\&. PKCS#11/PIV devices generally require initialization (i\&.e\&. storing a private/public key pair on them, see example below) before they can be used; FIDO2 security tokens generally do not required that, and work out of the box\&.
632 .sp
633 Added in version 245\&.
634 .RE
635 .PP
636 \fB\-\-fido2\-credential\-algorithm=\fR\fB\fISTRING\fR\fR
637 .RS 4
638 Specify COSE algorithm used in credential generation\&. The default value is
639 "es256"\&. Supported values are
640 "es256",
641 "rs256"
642 and
643 "eddsa"\&.
644 .sp
645 "es256"
646 denotes ECDSA over NIST P\-256 with SHA\-256\&.
647 "rs256"
648 denotes 2048\-bit RSA with PKCS#1\&.5 padding and SHA\-256\&.
649 "eddsa"
650 denotes EDDSA over Curve25519 with SHA\-512\&.
651 .sp
652 Note that your authenticator may choose not to support some algorithms\&.
653 .sp
654 Added in version 251\&.
655 .RE
656 .PP
657 \fB\-\-fido2\-device=\fR\fB\fIPATH\fR\fR
658 .RS 4
659 Takes a path to a Linux
660 "hidraw"
661 device (e\&.g\&.
662 /dev/hidraw1), referring to a FIDO2 security token implementing the
663 "hmac\-secret"
664 extension that shall be able to unlock the user account\&. A random salt value is generated on the host and passed to the FIDO2 device, which calculates a HMAC hash of the salt using an internal secret key\&. The result is then used as the key to unlock the user account\&. The random salt is included in the user record, so that whenever authentication is needed it can be passed to the FIDO2 token again\&.
665 .sp
666 Instead of a valid path to a FIDO2
667 "hidraw"
668 device the special strings
669 "list"
670 and
671 "auto"
672 may be specified\&. If
673 "list"
674 is passed, a brief table of suitable discovered FIDO2 devices is shown\&. If
675 "auto"
676 is passed, a suitable FIDO2 token is automatically selected, if exactly one is discovered\&. The latter is a useful shortcut for the most common case where a single FIDO2 hardware token is plugged in\&.
677 .sp
678 Note that FIDO2 devices suitable for this option must implement the
679 "hmac\-secret"
680 extension\&. Most current devices (such as the YubiKey 5 series) do\&. If the extension is not implemented the device cannot be used for unlocking home directories\&.
681 .sp
682 The FIDO2 device may be subsequently removed by setting the device path to an empty string (e\&.g\&.
683 \fBhomectl update $USER \-\-fido2\-device=""\fR)\&.
684 .sp
685 Note that many hardware security tokens implement both FIDO2 and PKCS#11/PIV (and thus may be used with either
686 \fB\-\-fido2\-device=\fR
687 or
688 \fB\-\-pkcs11\-token\-uri=\fR), for a discussion see above\&.
689 .sp
690 Added in version 246\&.
691 .RE
692 .PP
693 \fB\-\-fido2\-with\-client\-pin=\fR\fB\fIBOOL\fR\fR
694 .RS 4
695 When enrolling a FIDO2 security token, controls whether to require the user to enter a PIN when unlocking the account (the FIDO2
696 "clientPin"
697 feature)\&. Defaults to
698 "yes"\&. (Note: this setting is without effect if the security token does not support the
699 "clientPin"
700 feature at all, or does not allow enabling or disabling it\&.)
701 .sp
702 Added in version 249\&.
703 .RE
704 .PP
705 \fB\-\-fido2\-with\-user\-presence=\fR\fB\fIBOOL\fR\fR
706 .RS 4
707 When enrolling a FIDO2 security token, controls whether to require the user to verify presence (tap the token, the FIDO2
708 "up"
709 feature) when unlocking the account\&. Defaults to
710 "yes"\&. (Note: this setting is without effect if the security token does not support the
711 "up"
712 feature at all, or does not allow enabling or disabling it\&.)
713 .sp
714 Added in version 249\&.
715 .RE
716 .PP
717 \fB\-\-fido2\-with\-user\-verification=\fR\fB\fIBOOL\fR\fR
718 .RS 4
719 When enrolling a FIDO2 security token, controls whether to require user verification when unlocking the account (the FIDO2
720 "uv"
721 feature)\&. Defaults to
722 "no"\&. (Note: this setting is without effect if the security token does not support the
723 "uv"
724 feature at all, or does not allow enabling or disabling it\&.)
725 .sp
726 Added in version 249\&.
727 .RE
728 .PP
729 \fB\-\-recovery\-key=\fR\fB\fIBOOL\fR\fR
730 .RS 4
731 Accepts a boolean argument\&. If enabled a recovery key is configured for the account\&. A recovery key is a computer generated access key that may be used to regain access to an account if the password has been forgotten or the authentication token lost\&. The key is generated and shown on screen, and should be printed or otherwise transferred to a secure location\&. A recovery key may be entered instead of a regular password to unlock the account\&.
732 .sp
733 Added in version 247\&.
734 .RE
735 .SH "BLOB DIRECTORY USER RECORD PROPERTIES"
736 .PP
737 \fB\-\-blob=\fR\fB\fIPATH\fR\fR, \fB\-b\fR \fIPATH\fR, \fB\-\-blob=\fR\fB\fIFILENAME\fR\fR\fB=\fR\fB\fIPATH\fR\fR, \fB\-b\fR \fIFILENAME\fR=\fIPATH\fR
738 .RS 4
739 Accepts either a directory path, or a file name followed by a file path\&. If just a directory path is specified, then the user\*(Aqs entire blob directory is replaced the specified path\&. Note that this replacement is performed before per\-file manipulations are applied, which means these per\-file manipulations will be applied on top of the specified directory\&. If a filename and file path are specified, then the single specified blob file will be overwritten with the specified path\&. If completely blank, the entire blob directory is emptied out (which also resets all previous blob\-related flags up to this point)\&. If a filename is specified but the corresponding path is blank, that single file will be deleted from the blob directory\&. All changes are performed in temporary copies of the specified files in directories, which means that the originals specified on the command line are not modified\&. See
740 \m[blue]\fBUser Record Blob Directories\fR\m[]\&\s-2\u[3]\d\s+2
741 for more information about blob directories\&.
742 .sp
743 Added in version 256\&.
744 .RE
745 .PP
746 \fB\-\-avatar=\fR\fB\fIPATH\fR\fR, \fB\-\-login\-background=\fR\fB\fIPATH\fR\fR
747 .RS 4
748 Accept a file path\&. If set, the specified file is used to overwrite the corresponding file in the user\*(Aqs blob directory\&. If blank, the corresponding file is deleted from the blob directory\&. Essentially, these options are shortcuts to
749 \fB\-\-blob=\fR\fB\fIFILENAME\fR\fR\fB=\fR\fB\fIPATH\fR\fR
750 for the known filenames defined in
751 \m[blue]\fBUser Record Blob Directories\fR\m[]\&\s-2\u[3]\d\s+2\&.
752 .sp
753 Added in version 256\&.
754 .RE
755 .SH "ACCOUNT MANAGEMENT USER RECORD PROPERTIES"
756 .PP
757 \fB\-\-locked=\fR\fB\fIBOOLEAN\fR\fR
758 .RS 4
759 Takes a boolean argument\&. Specifies whether this user account shall be locked\&. If true logins into this account are prohibited, if false (the default) they are permitted (of course, only if authorization otherwise succeeds)\&.
760 .sp
761 Added in version 245\&.
762 .RE
763 .PP
764 \fB\-\-not\-before=\fR\fB\fITIMESTAMP\fR\fR, \fB\-\-not\-after=\fR\fB\fITIMESTAMP\fR\fR
765 .RS 4
766 These options take a timestamp string, in the format documented in
767 \fBsystemd.time\fR(7)
768 and configures points in time before and after logins into this account are not permitted\&.
769 .sp
770 Added in version 245\&.
771 .RE
772 .PP
773 \fB\-\-rate\-limit\-interval=\fR\fB\fISECS\fR\fR, \fB\-\-rate\-limit\-burst=\fR\fB\fINUMBER\fR\fR
774 .RS 4
775 Configures a rate limit on authentication attempts for this user\&. If the user attempts to authenticate more often than the specified number, on a specific system, within the specified time interval authentication is refused until the time interval passes\&. Defaults to 10 times per 1min\&.
776 .sp
777 Added in version 245\&.
778 .RE
779 .PP
780 \fB\-\-password\-hint=\fR\fB\fITEXT\fR\fR
781 .RS 4
782 Takes a password hint to store alongside the user record\&. This string is stored accessible only to privileged users and the user itself and may not be queried by other users\&. Example:
783 \fB\-\-password\-hint="My first pet\*(Aqs name"\fR\&.
784 .sp
785 Added in version 245\&.
786 .RE
787 .PP
788 \fB\-\-enforce\-password\-policy=\fR\fB\fIBOOL\fR\fR, \fB\-P\fR
789 .RS 4
790 Takes a boolean argument\&. Configures whether to enforce the system\*(Aqs password policy for this user, regarding quality and strength of selected passwords\&. Defaults to on\&.
791 \fB\-P\fR
792 is short for
793 \fB\-\-enforce\-password\-policy=no\fR\&.
794 .sp
795 Added in version 245\&.
796 .RE
797 .PP
798 \fB\-\-password\-change\-now=\fR\fB\fIBOOL\fR\fR
799 .RS 4
800 Takes a boolean argument\&. If true the user is asked to change their password on next login\&.
801 .sp
802 Added in version 245\&.
803 .RE
804 .PP
805 \fB\-\-password\-change\-min=\fR\fB\fITIME\fR\fR, \fB\-\-password\-change\-max=\fR\fB\fITIME\fR\fR, \fB\-\-password\-change\-warn=\fR\fB\fITIME\fR\fR, \fB\-\-password\-change\-inactive=\fR\fB\fITIME\fR\fR
806 .RS 4
807 Each of these options takes a time span specification as argument (in the syntax documented in
808 \fBsystemd.time\fR(7)) and configures various aspects of the user\*(Aqs password expiration policy\&. Specifically,
809 \fB\-\-password\-change\-min=\fR
810 configures how much time has to pass after changing the password of the user until the password may be changed again\&. If the user tries to change their password before this time passes the attempt is refused\&.
811 \fB\-\-password\-change\-max=\fR
812 configures how soon after it has been changed the password expires and needs to be changed again\&. After this time passes logging in may only proceed after the password is changed\&.
813 \fB\-\-password\-change\-warn=\fR
814 specifies how much earlier than then the time configured with
815 \fB\-\-password\-change\-max=\fR
816 the user is warned at login to change their password as it will expire soon\&. Finally,
817 \fB\-\-password\-change\-inactive=\fR
818 configures the time which has to pass after the password as expired until the user is not permitted to log in or change the password anymore\&. Note that these options only apply to password authentication, and do not apply to other forms of authentication, for example PKCS#11\-based security token authentication\&.
819 .sp
820 Added in version 245\&.
821 .RE
822 .SH "RESOURCE MANAGEMENT USER RECORD PROPERTIES"
823 .PP
824 \fB\-\-disk\-size=\fR\fB\fIBYTES\fR\fR
825 .RS 4
826 Either takes a size in bytes as argument (possibly using the usual K, M, G, \&... suffixes for 1024 base values), a percentage value, or the special strings
827 "min"
828 or
829 "max", and configures the disk space to assign to the user\&. If a percentage value is specified (i\&.e\&. the argument suffixed with
830 "%") it is taken relative to the available disk space of the backing file system\&. If specified as
831 "min"
832 assigns the minimal disk space permitted by the constraints of the backing file system and other limits, when specified as
833 "max"
834 assigns the maximum disk space available\&. If the LUKS2 backend is used this configures the size of the loopback file and file system contained therein\&. For the other storage backends configures disk quota using the filesystem\*(Aqs native quota logic, if available\&. If not specified, defaults to 85% of the available disk space for the LUKS2 backend and to no quota for the others\&.
835 .sp
836 Added in version 245\&.
837 .RE
838 .PP
839 \fB\-\-nice=\fR\fB\fINICE\fR\fR
840 .RS 4
841 Takes the numeric scheduling priority ("nice level") to apply to the processes of the user at login time\&. Takes a numeric value in the range \-20 (highest priority) to 19 (lowest priority)\&.
842 .sp
843 Added in version 245\&.
844 .RE
845 .PP
846 \fB\-\-rlimit=\fR\fB\fILIMIT\fR\fR\fB=\fR\fB\fIVALUE\fR\fR\fB[:\fIVALUE\fR]\fR
847 .RS 4
848 Allows configuration of resource limits for processes of this user, see
849 \fBgetrlimit\fR(2)
850 for details\&. Takes a resource limit name (e\&.g\&.
851 "LIMIT_NOFILE") followed by an equal sign, followed by a numeric limit\&. Optionally, separated by colon a second numeric limit may be specified\&. If two are specified this refers to the soft and hard limits, respectively\&. If only one limit is specified the setting sets both limits in one\&.
852 .sp
853 Added in version 245\&.
854 .RE
855 .PP
856 \fB\-\-tasks\-max=\fR\fB\fITASKS\fR\fR
857 .RS 4
858 Takes a non\-zero unsigned integer as argument\&. Configures the maximum number of tasks (i\&.e\&. threads, where each process is at least one thread) the user may have at any given time\&. This limit applies to all tasks forked off the user\*(Aqs sessions, even if they change user identity via
859 \fBsu\fR(1)
860 or a similar tool\&. Use
861 \fB\-\-rlimit=LIMIT_NPROC=\fR
862 to place a limit on the tasks actually running under the UID of the user, thus excluding any child processes that might have changed user identity\&. This controls the
863 \fITasksMax=\fR
864 setting of the per\-user systemd slice unit
865 user\-$UID\&.slice\&. See
866 \fBsystemd.resource-control\fR(5)
867 for further details\&.
868 .sp
869 Added in version 245\&.
870 .RE
871 .PP
872 \fB\-\-memory\-high=\fR\fB\fIBYTES\fR\fR, \fB\-\-memory\-max=\fR\fB\fIBYTES\fR\fR
873 .RS 4
874 Set a limit on the memory a user may take up on a system at any given time in bytes (the usual K, M, G, \&... suffixes are supported, to the base of 1024)\&. This includes all memory used by the user itself and all processes they forked off that changed user credentials\&. This controls the
875 \fIMemoryHigh=\fR
876 and
877 \fIMemoryMax=\fR
878 settings of the per\-user systemd slice unit
879 user\-$UID\&.slice\&. See
880 \fBsystemd.resource-control\fR(5)
881 for further details\&.
882 .sp
883 Added in version 245\&.
884 .RE
885 .PP
886 \fB\-\-cpu\-weight=\fR\fB\fIWEIGHT\fR\fR, \fB\-\-io\-weight=\fR\fB\fIWEIGHT\fR\fR
887 .RS 4
888 Set CPU and IO scheduling weights of the processes of the user, including those of processes forked off by the user that changed user credentials\&. Takes a numeric value in the range 1\&...10000\&. This controls the
889 \fICPUWeight=\fR
890 and
891 \fIIOWeight=\fR
892 settings of the per\-user systemd slice unit
893 user\-$UID\&.slice\&. See
894 \fBsystemd.resource-control\fR(5)
895 for further details\&.
896 .sp
897 Added in version 245\&.
898 .RE
899 .SH "STORAGE USER RECORD PROPERTIES"
900 .PP
901 \fB\-\-tmp\-limit=\fR\fB\fIBYTES\fR\fR, \fB\-\-tmp\-limit=\fR\fB\fIPERCENT\fR\fR, \fB\-\-dev\-shm\-limit=\fR\fB\fIBYTES\fR\fR, \fB\-\-dev\-shm\-limit=\fR\fB\fIPERCENT\fR\fR
902 .RS 4
903 Controls the per\-user quota on
904 /tmp/
905 and
906 /dev/shm/
907 that is applied when the user logs in\&. Takes either an absolute value in bytes (with the usual K, M, G, T suffixes to the base of 1024), or a percentage\&. In the latter case the limit is applied relative to the size of the respective file system\&. This limit is only applied if the relevant file system is
908 "tmpfs"
909 and has no effect otherwise\&. Note that if these options are not used, a default quota might still be enforced (typically 80%\&.)
910 .sp
911 Added in version 258\&.
912 .RE
913 .PP
914 \fB\-\-storage=\fR\fB\fISTORAGE\fR\fR
915 .RS 4
916 Selects the storage mechanism to use for this home directory\&. Takes one of
917 "luks",
918 "fscrypt",
919 "directory",
920 "subvolume",
921 "cifs"\&. For details about these mechanisms, see above\&. If a new home directory is created and the storage type is not specifically specified,
922 \fBhomed.conf\fR(5)
923 defines which default storage to use\&.
924 .sp
925 Added in version 245\&.
926 .RE
927 .PP
928 \fB\-\-image\-path=\fR\fB\fIPATH\fR\fR
929 .RS 4
930 Takes a file system path\&. Configures where to place the user\*(Aqs home directory\&. When LUKS2 storage is used refers to the path to the loopback file, otherwise to the path to the home directory (which may be in
931 /home/
932 or any other accessible filesystem)\&. When unspecified defaults to
933 /home/$USER\&.home
934 when LUKS storage is used and
935 /home/$USER\&.homedir
936 for the other storage mechanisms\&. Not defined for the
937 "cifs"
938 storage mechanism\&. To use LUKS2 storage on a regular block device (for example a USB stick) pass the path to the block device here\&. Specifying the path to a directory here when using LUKS2 storage is not allowed\&. Similar, specifying the path to a regular file or device node is not allowed if any of the other storage backends are used\&.
939 .sp
940 Added in version 245\&.
941 .RE
942 .PP
943 \fB\-\-drop\-caches=\fR\fB\fIBOOL\fR\fR
944 .RS 4
945 Automatically flush OS file system caches on logout\&. This is useful in combination with the fscrypt storage backend to ensure the OS does not keep decrypted versions of the files and directories in memory (and accessible) after logout\&. This option is also supported on other backends, but should not bring any benefit there\&. Defaults to off, except if the selected storage backend is fscrypt, where it defaults to on\&. Note that flushing OS caches will negatively influence performance of the OS shortly after logout\&.
946 .sp
947 Added in version 250\&.
948 .RE
949 .SH "LUKS STORAGE USER RECORD PROPERTIES"
950 .PP
951 \fB\-\-fs\-type=\fR\fB\fITYPE\fR\fR
952 .RS 4
953 When LUKS2 storage is used configures the file system type to use inside the home directory LUKS2 container\&. One of
954 "btrfs",
955 "ext4",
956 "xfs"\&. If not specified
957 \fBhomed.conf\fR(5)
958 defines which default file system type to use\&. Note that
959 "xfs"
960 is not recommended as its support for file system resizing is too limited\&.
961 .sp
962 Added in version 245\&.
963 .RE
964 .PP
965 \fB\-\-luks\-discard=\fR\fB\fIBOOL\fR\fR
966 .RS 4
967 When LUKS2 storage is used configures whether to enable the
968 "discard"
969 feature of the file system\&. If enabled the file system on top of the LUKS2 volume will report empty block information to LUKS2 and the loopback file below, ensuring that empty space in the home directory is returned to the backing file system below the LUKS2 volume, resulting in a "sparse" loopback file\&. This option mostly defaults to off, since this permits over\-committing home directories which results in I/O errors if the underlying file system runs full while the upper file system wants to allocate a block\&. Such I/O errors are generally not handled well by file systems nor applications\&. When LUKS2 storage is used on top of regular block devices (instead of on top a loopback file) the discard logic defaults to on\&.
970 .sp
971 Added in version 245\&.
972 .RE
973 .PP
974 \fB\-\-luks\-offline\-discard=\fR\fB\fIBOOL\fR\fR
975 .RS 4
976 Similar to
977 \fB\-\-luks\-discard=\fR, controls the trimming of the file system\&. However, while
978 \fB\-\-luks\-discard=\fR
979 controls what happens when the home directory is active,
980 \fB\-\-luks\-offline\-discard=\fR
981 controls what happens when it becomes inactive, i\&.e\&. whether to trim/allocate the storage when deactivating the home directory\&. This option defaults to on, to ensure disk space is minimized while a user is not logged in\&.
982 .sp
983 Added in version 246\&.
984 .RE
985 .PP
986 \fB\-\-luks\-extra\-mount\-options=\fR\fB\fIOPTIONS\fR\fR
987 .RS 4
988 Takes a string containing additional mount options to use when mounting the LUKS volume\&. If specified, this string will be appended to the default, built\-in mount options\&. Defaults to "compress=zstd:1,noacl,user_subvol_rm_allowed"\&.
989 .sp
990 Added in version 250\&.
991 .RE
992 .PP
993 \fB\-\-luks\-cipher=\fR\fB\fICIPHER\fR\fR, \fB\-\-luks\-cipher\-mode=\fR\fB\fIMODE\fR\fR, \fB\-\-luks\-volume\-key\-size=\fR\fB\fIBYTES\fR\fR, \fB\-\-luks\-pbkdf\-type=\fR\fB\fITYPE\fR\fR, \fB\-\-luks\-pbkdf\-hash\-algorithm=\fR\fB\fIALGORITHM\fR\fR, \fB\-\-luks\-pbkdf\-force\-iterations=\fR\fB\fIITERATIONS\fR\fR, \fB\-\-luks\-pbkdf\-time\-cost=\fR\fB\fISECONDS\fR\fR, \fB\-\-luks\-pbkdf\-memory\-cost=\fR\fB\fIBYTES\fR\fR, \fB\-\-luks\-pbkdf\-parallel\-threads=\fR\fB\fITHREADS\fR\fR, \fB\-\-luks\-sector\-size=\fR\fB\fIBYTES\fR\fR
994 .RS 4
995 Configures various cryptographic parameters for the LUKS2 storage mechanism\&. See
996 \fBcryptsetup\fR(8)
997 for details on the specific attributes\&.
998 .sp
999 Note that
1000 \fBhomectl\fR
1001 uses bytes for key size, like
1002 /proc/crypto, but
1003 \fBcryptsetup\fR(8)
1004 uses bits\&.
1005 .sp
1006 Added in version 245\&.
1007 .RE
1008 .PP
1009 \fB\-\-auto\-resize\-mode=\fR
1010 .RS 4
1011 Configures whether to automatically grow and/or shrink the backing file system on login and logout\&. Takes one of the strings
1012 "off",
1013 "grow",
1014 "shrink\-and\-grow"\&. Only applies to the LUKS2 backend currently, and if the btrfs file system is used inside it (since only then online growing/shrinking of the file system is supported)\&. Defaults to
1015 "shrink\-and\-grow", if LUKS2/btrfs is used, otherwise is off\&. If set to
1016 "off"
1017 no automatic shrinking/growing during login or logout is done\&. If set to
1018 "grow"
1019 the home area is grown to the size configured via
1020 \fB\-\-disk\-size=\fR
1021 should it currently be smaller\&. If it already matches the configured size or is larger no operation is executed\&. If set to
1022 "shrink\-and\-grow"
1023 the home area is also resized during logout to the minimal size the used disk space and file system constraints permit\&. This mode thus ensures that while a home area is activated it is sized to the configured size, but while deactivated it is compacted taking up only the minimal space possible\&. Note that if the system is powered off abnormally or if the user otherwise not logged out cleanly the shrinking operation will not take place, and the user has to re\-login/logout again before it is executed again\&.
1024 .sp
1025 Added in version 250\&.
1026 .RE
1027 .PP
1028 \fB\-\-rebalance\-weight=\fR
1029 .RS 4
1030 Configures the weight parameter for the free disk space rebalancing logic\&. Only applies to the LUKS2 backend (since for the LUKS2 backend disk space is allocated from a per\-user loopback file system instead of immediately from a common pool like the other backends do it)\&. In regular intervals free disk space in the active home areas and their backing storage is redistributed among them, taking the weight value configured here into account\&. Expects an integer in the range 1\&...10000, or the special string
1031 "off"\&. If not specified, defaults to 100\&. The weight is used to scale free space made available to the home areas: a home area with a weight of 200 will get twice the free space as one with a weight of 100; a home area with a weight of 50 will get half of that\&. The backing file system will be assigned space for a weight of 20\&. If set to
1032 "off"
1033 no automatic free space distribution is done for this home area\&. Note that resizing the home area explicitly (with
1034 \fBhomectl resize\fR
1035 see below) will implicitly turn off the automatic rebalancing\&. To reenable the automatic rebalancing use
1036 \fB\-\-rebalance\-weight=\fR
1037 with an empty parameter\&.
1038 .sp
1039 Added in version 250\&.
1040 .RE
1041 .SH "MOUNTING USER RECORD PROPERTIES"
1042 .PP
1043 \fB\-\-nosuid=\fR\fB\fIBOOL\fR\fR, \fB\-\-nodev=\fR\fB\fIBOOL\fR\fR, \fB\-\-noexec=\fR\fB\fIBOOL\fR\fR
1044 .RS 4
1045 Configures the
1046 "nosuid",
1047 "nodev"
1048 and
1049 "noexec"
1050 mount options for the home directories\&. By default,
1051 "nodev"
1052 and
1053 "nosuid"
1054 are on, while
1055 "noexec"
1056 is off\&. For details about these mount options see
1057 \fBmount\fR(8)\&.
1058 .sp
1059 Added in version 245\&.
1060 .RE
1061 .SH "CIFS USER RECORD PROPERTIES"
1062 .PP
1063 \fB\-\-cifs\-domain=\fR\fB\fIDOMAIN\fR\fR, \fB\-\-cifs\-user\-name=\fR\fB\fIUSER\fR\fR, \fB\-\-cifs\-service=\fR\fB\fISERVICE\fR\fR, \fB\-\-cifs\-extra\-mount\-options=\fR\fB\fIOPTIONS\fR\fR
1064 .RS 4
1065 Configures the Windows File Sharing (CIFS) domain and user to associate with the home directory/user account, as well as the file share ("service") to mount as directory\&. The latter is used when
1066 "cifs"
1067 storage is selected\&. The file share should be specified in format
1068 "//\fIhost\fR/\fIshare\fR/\fIdirectory/\&...\fR"\&. The directory part is optional \(em if not specified, the home directory will be placed in the top\-level directory of the share\&. The
1069 \fB\-\-cifs\-extra\-mount\-options=\fR
1070 setting allows specifying additional mount options when mounting the share, see
1071 \fBmount.cifs\fR(8)
1072 for details\&.
1073 .sp
1074 Added in version 245\&.
1075 .RE
1076 .SH "LOGIN BEHAVIOUR RECORD PROPERTIES"
1077 .PP
1078 \fB\-\-stop\-delay=\fR\fB\fISECS\fR\fR
1079 .RS 4
1080 Configures the time the per\-user service manager shall continue to run after the all sessions of the user ended\&. The default is configured in
1081 \fBlogind.conf\fR(5)
1082 (for home directories of LUKS2 storage located on removable media this defaults to 0 though)\&. A longer time makes sure quick, repetitive logins are more efficient as the user\*(Aqs service manager does not have to be started every time\&.
1083 .sp
1084 Added in version 245\&.
1085 .RE
1086 .PP
1087 \fB\-\-kill\-processes=\fR\fB\fIBOOL\fR\fR
1088 .RS 4
1089 Configures whether to kill all processes of the user on logout\&. The default is configured in
1090 \fBlogind.conf\fR(5)\&.
1091 .sp
1092 Added in version 245\&.
1093 .RE
1094 .PP
1095 \fB\-\-auto\-login=\fR\fB\fIBOOL\fR\fR
1096 .RS 4
1097 Takes a boolean argument\&. Configures whether the graphical UI of the system should automatically log this user in if possible\&. Defaults to off\&. If less or more than one user is marked this way automatic login is disabled\&.
1098 .sp
1099 Added in version 245\&.
1100 .RE
1101 .PP
1102 \fB\-\-session\-launcher=\fR\fB\fILAUNCHER\fR\fR
1103 .RS 4
1104 Takes a string argument\&. Configures the user\*(Aqs preferred session launcher \&.desktop entry file (i\&.e\&.
1105 "gnome",
1106 "plasma", or other names that appear in
1107 /usr/share/xesssions/
1108 or
1109 /usr/share/wayland\-sessions)\&. This is read by the display manager to pick the default session that is launched when the user logs in\&.
1110 .sp
1111 Added in version 256\&.
1112 .RE
1113 .PP
1114 \fB\-\-session\-type=\fR\fB\fITYPE\fR\fR
1115 .RS 4
1116 Takes a string argument\&. Configures the user\*(Aqs preferred session type (i\&.e\&.
1117 "x11",
1118 "wayland", and other values accepted by
1119 \fI$XDG_SESSION_TYPE\fR)\&. This is read by the display manage to pick the default session type the user is logged into\&.
1120 .sp
1121 Added in version 256\&.
1122 .RE
1123 .SH "COMMANDS"
1124 .PP
1125 The following commands are understood:
1126 .PP
1127 \fBlist\fR
1128 .RS 4
1129 List all home directories (along with brief details) currently managed by
1130 systemd\-homed\&.service\&. This command is also executed if none is specified on the command line\&. (Note that the list of users shown by this command does not include users managed by other subsystems, such as system users or any traditional users listed in
1131 /etc/passwd\&.)
1132 .sp
1133 Added in version 245\&.
1134 .RE
1135 .PP
1136 \fBactivate\fR \fIUSER\fR [\fIUSER\&...\fR]
1137 .RS 4
1138 Activate one or more home directories\&. The home directories of each listed user will be activated and made available under their mount points (typically in
1139 /home/$USER)\&. Note that any home activated this way stays active indefinitely, until it is explicitly deactivated again (with
1140 \fBdeactivate\fR, see below), or the user logs in and out again and it thus is deactivated due to the automatic deactivation\-on\-logout logic\&.
1141 .sp
1142 Activation of a home directory involves various operations that depend on the selected storage mechanism\&. If the LUKS2 mechanism is used, this generally involves: inquiring the user for a password, setting up a loopback device, validating and activating the LUKS2 volume, checking the file system, mounting the file system, and potentially changing the ownership of all included files to the correct UID/GID\&.
1143 .sp
1144 Added in version 245\&.
1145 .RE
1146 .PP
1147 \fBdeactivate\fR \fIUSER\fR [\fIUSER\&...\fR]
1148 .RS 4
1149 Deactivate one or more home directories\&. This undoes the effect of
1150 \fBactivate\fR\&.
1151 .sp
1152 Added in version 245\&.
1153 .RE
1154 .PP
1155 \fBinspect\fR \fIUSER\fR [\fIUSER\&...\fR]
1156 .RS 4
1157 Show various details about the specified home directories\&. This shows various information about the home directory and its user account, including runtime data such as current state, disk use and similar\&. Combine with
1158 \fB\-\-json=\fR
1159 to show the detailed JSON user record instead, possibly combined with
1160 \fB\-\-export\-format=\fR
1161 to suppress certain aspects of the output\&.
1162 .sp
1163 Added in version 245\&.
1164 .RE
1165 .PP
1166 \fBauthenticate\fR \fIUSER\fR [\fIUSER\&...\fR]
1167 .RS 4
1168 Validate authentication credentials of a home directory\&. This queries the caller for a password (or similar) and checks that it correctly unlocks the home directory\&. This leaves the home directory in the state it is in, i\&.e\&. it leaves the home directory in inactive state if it was inactive before, and in active state if it was active before\&.
1169 .sp
1170 Added in version 245\&.
1171 .RE
1172 .PP
1173 \fBcreate\fR \fIUSER\fR, \fBcreate\fR \fB\-\-identity=\fR\fB\fIPATH\fR\fR [\fIUSER\fR]
1174 .RS 4
1175 Create a new home directory/user account of the specified name\&. Use the various user record property options (as documented above) to control various aspects of the home directory and its user accounts\&.
1176 .sp
1177 The specified user name should follow the strict syntax described on
1178 \m[blue]\fBUser/Group Name Syntax\fR\m[]\&\s-2\u[4]\d\s+2\&.
1179 .sp
1180 Added in version 245\&.
1181 .RE
1182 .PP
1183 \fBadopt\fR \fIPATH\fR [\fIPATH\fR\&...]
1184 .RS 4
1185 Adopts one or more existing home directories on the local system\&. Takes one or more paths to
1186 *\&.home
1187 LUKS home directories or
1188 *\&.homedir/
1189 standalone home directories or subvolumes previously created by
1190 systemd\-homed
1191 and makes them available locally for login\&. The referenced files are not moved\&. This is an alternative for moving such home directories into
1192 /home/
1193 (where they would be picked up automatically)\&.
1194 .sp
1195 Added in version 258\&.
1196 .RE
1197 .PP
1198 \fBregister\fR \fIFILE\fR [\fIFILE\fR\&...]
1199 .RS 4
1200 Registers one or more users, without creating their home directories\&. Takes one or more paths to JSON user record files\&. If the path is specified as
1201 "\-"
1202 reads the JSON user record from standard input\&.
1203 .sp
1204 Registering a user makes it accessible on the local system without creating a new home directory\&. This is particularly useful for making a user accessible on a system it was not originally created on\&.
1205 .sp
1206 Here\*(Aqs an example how to make a local user account with its home directory accessible on a remote system, using SMB/CIFS file sharing\&. With Samba installed in its default configuration invoke as
1207 "root":
1208 .sp
1209 .if n \{\
1210 .RS 4
1211 .\}
1212 .nf
1213 # smbpasswd \-a lennart
1214 .fi
1215 .if n \{\
1216 .RE
1217 .\}
1218 .sp
1219 Continue as regular user
1220 "lennart":
1221 .sp
1222 .if n \{\
1223 .RS 4
1224 .\}
1225 .nf
1226 $ homectl update lennart \-\-ssh\-authorized\-keys=\&... \-N \-\-storage=cifs \-\-cifs\-service="//$HOSTNAME/lennart"
1227 $ homectl get\-signing\-key | ssh targetsystem homectl add\-signing\-key \-\-key\-name="$HOSTNAME"\&.public
1228 $ homectl inspect \-E lennart | ssh targetsystem homectl register \-
1229 $ ssh lennart@targetsystem
1230 .fi
1231 .if n \{\
1232 .RE
1233 .\}
1234 .sp
1235 This first ensures the user account
1236 "lennart"
1237 is known to and accessible by Samba\&. It then registers a local SSH access that shall be used for accessing this user, and configures CIFS as default storage for non\-local systems on the account\&. It then adds the local system\*(Aqs account signing key to the target system\&. Then it registers the local user account with the target system\&. Finally it logs into the account on the target system\&. The target system will then connect back via SMB/CIFS to access the home directory\&.
1238 .sp
1239 Added in version 258\&.
1240 .RE
1241 .PP
1242 \fBunregister\fR \fIUSER\fR\&...
1243 .RS 4
1244 Unregisters one or more user accounts\&. This only removes the user record from the local system, it does not delete the home directory\&. The home directory can be readded via the
1245 \fBregister\fR
1246 or
1247 \fBadopt\fR
1248 command later, on this or another system\&. Note that unregistering a user whose home directory is placed in
1249 /home/
1250 will not make the user disappear from the local user database, as all supported home directories placed there will show up in the user database\&. However, the user record will become "unfixated", i\&.e\&. lose its binding to the local system\&. When logged into it will automatically regain the binding, and acquire a local UID/GID pair\&.
1251 .sp
1252 Added in version 258\&.
1253 .RE
1254 .PP
1255 \fBremove\fR \fIUSER\fR
1256 .RS 4
1257 Remove a home directory/user account\&. This will remove both the home directory\*(Aqs user record and the home directory itself, and thus delete all files and directories owned by the user\&.
1258 .sp
1259 Added in version 245\&.
1260 .RE
1261 .PP
1262 \fBupdate\fR \fIUSER\fR, \fBupdate\fR \fB\-\-identity=\fR\fB\fIPATH\fR\fR [\fIUSER\fR]
1263 .RS 4
1264 Update a home directory/user account\&. Use the various user record property options (as documented above) to make changes to the account, or alternatively provide a full, updated JSON user record via the
1265 \fB\-\-identity=\fR
1266 option\&.
1267 .sp
1268 Note that changes to user records not signed by a cryptographic private key available locally are not permitted, unless
1269 \fB\-\-identity=\fR
1270 is used with a user record that is already correctly signed by a recognized private key\&.
1271 .sp
1272 Added in version 245\&.
1273 .RE
1274 .PP
1275 \fBpasswd\fR \fIUSER\fR
1276 .RS 4
1277 Change the password of the specified home directory/user account\&.
1278 .sp
1279 Added in version 245\&.
1280 .RE
1281 .PP
1282 \fBresize\fR \fIUSER\fR \fIBYTES\fR
1283 .RS 4
1284 Change the disk space assigned to the specified home directory\&. If the LUKS2 storage mechanism is used this will automatically resize the loopback file and the file system contained within\&. Note that if
1285 "ext4"
1286 is used inside of the LUKS2 volume, it is necessary to deactivate the home directory before shrinking it (i\&.e the user has to log out)\&. Growing can be done while the home directory is active\&. If
1287 "xfs"
1288 is used inside of the LUKS2 volume the home directory may not be shrunk whatsoever\&. On all three of
1289 "ext4",
1290 "xfs"
1291 and
1292 "btrfs"
1293 the home directory may be grown while the user is logged in, and on the latter also shrunk while the user is logged in\&. If the
1294 "subvolume",
1295 "directory",
1296 "fscrypt"
1297 storage mechanisms are used, resizing will change file system quota\&. The size parameter may make use of the usual suffixes B, K, M, G, T (to the base of 1024)\&. The special strings
1298 "min"
1299 and
1300 "max"
1301 may be specified in place of a numeric size value, for minimizing or maximizing disk space assigned to the home area, taking constraints of the file system, disk usage inside the home area and on the backing storage into account\&.
1302 .sp
1303 Added in version 245\&.
1304 .RE
1305 .PP
1306 \fBlock\fR \fIUSER\fR
1307 .RS 4
1308 Temporarily suspend access to the user\*(Aqs home directory and remove any associated cryptographic keys from memory\&. Any attempts to access the user\*(Aqs home directory will stall until the home directory is unlocked again (i\&.e\&. re\-authenticated)\&. This functionality is primarily intended to be used during system suspend to make sure the user\*(Aqs data cannot be accessed until the user re\-authenticates on resume\&. This operation is only defined for home directories that use the LUKS2 storage mechanism\&.
1309 .sp
1310 Added in version 245\&.
1311 .RE
1312 .PP
1313 \fBunlock\fR \fIUSER\fR
1314 .RS 4
1315 Resume access to the user\*(Aqs home directory again, undoing the effect of
1316 \fBlock\fR
1317 above\&. This requires authentication of the user, as the cryptographic keys required for access to the home directory need to be reacquired\&.
1318 .sp
1319 Added in version 245\&.
1320 .RE
1321 .PP
1322 \fBlock\-all\fR
1323 .RS 4
1324 Execute the
1325 \fBlock\fR
1326 command on all suitable home directories at once\&. This operation is generally executed on system suspend (i\&.e\&. by
1327 \fBsystemctl suspend\fR
1328 and related commands), to ensure all active user\*(Aqs cryptographic keys for accessing their home directories are removed from memory\&.
1329 .sp
1330 Added in version 245\&.
1331 .RE
1332 .PP
1333 \fBdeactivate\-all\fR
1334 .RS 4
1335 Execute the
1336 \fBdeactivate\fR
1337 command on all active home directories at once\&. This operation is generally executed on system shut down (i\&.e\&. by
1338 \fBsystemctl poweroff\fR
1339 and related commands), to ensure all active user\*(Aqs home directories are fully deactivated before
1340 /home/
1341 and related file systems are unmounted\&.
1342 .sp
1343 Added in version 247\&.
1344 .RE
1345 .PP
1346 \fBwith\fR \fIUSER\fR \fICOMMAND\&...\fR
1347 .RS 4
1348 Activate the specified user\*(Aqs home directory, run the specified command (under the caller\*(Aqs identity, not the specified user\*(Aqs) and deactivate the home directory afterwards again (unless the user is logged in otherwise)\&. This command is useful for running privileged backup scripts and such, but requires authentication with the user\*(Aqs credentials in order to be able to unlock the user\*(Aqs home directory\&.
1349 .sp
1350 Added in version 245\&.
1351 .RE
1352 .PP
1353 \fBrebalance\fR
1354 .RS 4
1355 Rebalance free disk space between active home areas and the backing storage\&. See
1356 \fB\-\-rebalance\-weight=\fR
1357 above\&. This executes no operation unless there\*(Aqs at least one active LUKS2 home area that has disk space rebalancing enabled\&. This operation is synchronous: it will only complete once disk space is rebalanced according to the rebalancing weights\&. Note that rebalancing also takes place automatically in the background in regular intervals\&. Use this command to synchronously ensure disk space is properly redistributed before initiating an operation requiring large amounts of disk space\&.
1358 .sp
1359 Added in version 250\&.
1360 .RE
1361 .PP
1362 \fBfirstboot\fR
1363 .RS 4
1364 This command is supposed to be invoked during the initial boot of the system\&. It checks whether any regular home area exists so far, and if not queries the user interactively on the console for user name and password and creates one (only if
1365 \fB\-\-prompt\-new\-user\fR
1366 is specified)\&. Alternatively, if one or more service credentials whose name starts with
1367 "home\&.create\&."
1368 are passed to the command (containing a user record in JSON format) these users are automatically created at boot\&.
1369 .sp
1370 This command is invoked by the
1371 systemd\-homed\-firstboot\&.service
1372 service unit\&.
1373 .sp
1374 Added in version 256\&.
1375 .RE
1376 .PP
1377 \fBlist\-signing\-keys\fR
1378 .RS 4
1379 Show a list of public keys that home directories can be signed with to be allowed for local login\&. One such key (local\&.public) will be generated automatically for signing locally created home directories, but additional public keys may be registered to accept home directories from other origins too (see
1380 \fBadd\-signing\-key\fR
1381 below)\&.
1382 .sp
1383 Added in version 258\&.
1384 .RE
1385 .PP
1386 \fBget\-signing\-key\fR [\fINAME\&...\fR]
1387 .RS 4
1388 Write the public key identified by the specified name to standard output (in PEM format)\&. If no name is specified defaults to
1389 local\&.public, i\&.e\&. the automatically generated key for locally created home directories\&.
1390 .sp
1391 Added in version 258\&.
1392 .RE
1393 .PP
1394 \fBadd\-signing\-key\fR [\fIFILE\&...\fR]
1395 .RS 4
1396 Add public key(s) from the specified PEM key file(s) to the list of keys that home areas have to be signed by to be permitted for local login\&. If a path of
1397 "\-"
1398 is specified, or if no file is specified at all, the key will be read from standard input\&. The key file name(s) must carry the
1399 \&.public
1400 suffix, and the file name(s) will be used to name the key(s) once added, too\&. If a key is added from standard input the key name must be specified explicitly via
1401 \fB\-\-key\-name=\fR, see above\&.
1402 .sp
1403 This command is useful for permitting local home directories to be used on a remote system\&. Example:
1404 .sp
1405 .if n \{\
1406 .RS 4
1407 .\}
1408 .nf
1409 homectl get\-signing\-key | ssh myotherhost homectl add\-signing\-key \-\-key\-name="$HOSTNAME"\&.public
1410 .fi
1411 .if n \{\
1412 .RE
1413 .\}
1414 .sp
1415 Added in version 258\&.
1416 .RE
1417 .PP
1418 \fBremove\-signing\-key\fR \fINAME\&...\fR
1419 .RS 4
1420 Remove the public key identified by the specified name from the list of keys that control from which origins to permit home directories for login\&.
1421 .sp
1422 Added in version 258\&.
1423 .RE
1424 .SH "CREDENTIALS"
1425 .PP
1426 When invoked with the
1427 \fBfirstboot\fR
1428 command,
1429 \fBhomectl\fR
1430 supports the service credentials logic as implemented by
1431 \fIImportCredential=\fR/\fILoadCredential=\fR/\fISetCredential=\fR
1432 (see
1433 \fBsystemd.exec\fR(5)
1434 for details)\&. The following credentials are used when passed in:
1435 .PP
1436 \fIhome\&.create\&.*\fR
1437 .RS 4
1438 If one or more credentials whose names begin with
1439 "home\&.create\&.", followed by a valid UNIX username are passed, a new home area is created, one for each specified user record\&.
1440 .sp
1441 Added in version 256\&.
1442 .RE
1443 .SH "KERNEL COMMAND LINE"
1444 .PP
1445 \fIsystemd\&.firstboot=\fR
1446 .RS 4
1447 This boolean will disable the effect of
1448 \fBhomectl firstboot\fR
1449 command\&. It\*(Aqs primarily interpreted by
1450 \fBsystemd-firstboot\fR(1)\&.
1451 .sp
1452 Added in version 256\&.
1453 .RE
1454 .SH "EXIT STATUS"
1455 .PP
1456 On success, 0 is returned, a non\-zero failure code otherwise\&.
1457 .PP
1458 When a command is invoked with
1459 \fBwith\fR, the exit status of the child is propagated\&. Effectively,
1460 \fBhomectl\fR
1461 will exit without error if the command is successfully invoked
1462 \fIand\fR
1463 finishes successfully\&.
1464 .SH "ENVIRONMENT"
1465 .PP
1466 \fI$SYSTEMD_LOG_LEVEL\fR
1467 .RS 4
1468 The maximum log level of emitted messages (messages with a higher log level, i\&.e\&. less important ones, will be suppressed)\&. Takes a comma\-separated list of values\&. A value may be either one of (in order of decreasing importance)
1469 \fBemerg\fR,
1470 \fBalert\fR,
1471 \fBcrit\fR,
1472 \fBerr\fR,
1473 \fBwarning\fR,
1474 \fBnotice\fR,
1475 \fBinfo\fR,
1476 \fBdebug\fR, or an integer in the range 0\&...7\&. See
1477 \fBsyslog\fR(3)
1478 for more information\&. Each value may optionally be prefixed with one of
1479 \fBconsole\fR,
1480 \fBsyslog\fR,
1481 \fBkmsg\fR
1482 or
1483 \fBjournal\fR
1484 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
1485 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
1486 specifies to log at debug level except when logging to the console which should be at info level)\&. Note that the global maximum log level takes priority over any per target maximum log levels\&.
1487 .RE
1488 .PP
1489 \fI$SYSTEMD_LOG_COLOR\fR
1490 .RS 4
1491 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
1492 .sp
1493 This setting is only useful when messages are written directly to the terminal, because
1494 \fBjournalctl\fR(1)
1495 and other tools that display logs will color messages based on the log level on their own\&.
1496 .RE
1497 .PP
1498 \fI$SYSTEMD_LOG_TIME\fR
1499 .RS 4
1500 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
1501 .sp
1502 This setting is only useful when messages are written directly to the terminal or a file, because
1503 \fBjournalctl\fR(1)
1504 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
1505 .RE
1506 .PP
1507 \fI$SYSTEMD_LOG_LOCATION\fR
1508 .RS 4
1509 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
1510 .sp
1511 Note that the log location is often attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
1512 .RE
1513 .PP
1514 \fI$SYSTEMD_LOG_TID\fR
1515 .RS 4
1516 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
1517 .sp
1518 Note that the this information is attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
1519 .RE
1520 .PP
1521 \fI$SYSTEMD_LOG_TARGET\fR
1522 .RS 4
1523 The destination for log messages\&. One of
1524 \fBconsole\fR
1525 (log to the attached tty),
1526 \fBconsole\-prefixed\fR
1527 (log to the attached tty but with prefixes encoding the log level and "facility", see
1528 \fBsyslog\fR(3),
1529 \fBkmsg\fR
1530 (log to the kernel circular log buffer),
1531 \fBjournal\fR
1532 (log to the journal),
1533 \fBjournal\-or\-kmsg\fR
1534 (log to the journal if available, and to kmsg otherwise),
1535 \fBauto\fR
1536 (determine the appropriate log target automatically, the default),
1537 \fBnull\fR
1538 (disable log output)\&.
1539 .RE
1540 .PP
1541 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
1542 .RS 4
1543 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
1544 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
1545 .RE
1546 .PP
1547 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
1548 .RS 4
1549 Pager to use when
1550 \fB\-\-no\-pager\fR
1551 is not given\&.
1552 \fI$SYSTEMD_PAGER\fR
1553 is used if set; otherwise
1554 \fI$PAGER\fR
1555 is used\&. If neither
1556 \fI$SYSTEMD_PAGER\fR
1557 nor
1558 \fI$PAGER\fR
1559 are set, a set of well\-known pager implementations is tried in turn, including
1560 \fBless\fR(1)
1561 and
1562 \fBmore\fR(1), until one is found\&. If no pager implementation is discovered, no pager is invoked\&. Setting those environment variables to an empty string or the value
1563 "cat"
1564 is equivalent to passing
1565 \fB\-\-no\-pager\fR\&.
1566 .sp
1567 Note: if
1568 \fI$SYSTEMD_PAGERSECURE\fR
1569 is not set,
1570 \fI$SYSTEMD_PAGER\fR
1571 and
1572 \fI$PAGER\fR
1573 can only be used to disable the pager (with
1574 "cat"
1575 or
1576 ""), and are otherwise ignored\&.
1577 .RE
1578 .PP
1579 \fI$SYSTEMD_LESS\fR
1580 .RS 4
1581 Override the options passed to
1582 \fBless\fR
1583 (by default
1584 "FRSXMK")\&.
1585 .sp
1586 Users might want to change two options in particular:
1587 .PP
1588 \fBK\fR
1589 .RS 4
1590 This option instructs the pager to exit immediately when
1591 Ctrl+C
1592 is pressed\&. To allow
1593 \fBless\fR
1594 to handle
1595 Ctrl+C
1596 itself to switch back to the pager command prompt, unset this option\&.
1597 .sp
1598 If the value of
1599 \fI$SYSTEMD_LESS\fR
1600 does not include
1601 "K", and the pager that is invoked is
1602 \fBless\fR,
1603 Ctrl+C
1604 will be ignored by the executable, and needs to be handled by the pager\&.
1605 .RE
1606 .PP
1607 \fBX\fR
1608 .RS 4
1609 This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal\&. It is set by default to allow command output to remain visible in the terminal even after the pager exits\&. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse\&.
1610 .RE
1611 .sp
1612 Note that setting the regular
1613 \fI$LESS\fR
1614 environment variable has no effect for
1615 \fBless\fR
1616 invocations by systemd tools\&.
1617 .sp
1618 See
1619 \fBless\fR(1)
1620 for more discussion\&.
1621 .RE
1622 .PP
1623 \fI$SYSTEMD_LESSCHARSET\fR
1624 .RS 4
1625 Override the charset passed to
1626 \fBless\fR
1627 (by default
1628 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
1629 .sp
1630 Note that setting the regular
1631 \fI$LESSCHARSET\fR
1632 environment variable has no effect for
1633 \fBless\fR
1634 invocations by systemd tools\&.
1635 .RE
1636 .PP
1637 \fI$SYSTEMD_PAGERSECURE\fR
1638 .RS 4
1639 Common pager commands like
1640 \fBless\fR(1), in addition to "paging", i\&.e\&. scrolling through the output, support opening of or writing to other files and running arbitrary shell commands\&. When commands are invoked with elevated privileges, for example under
1641 \fBsudo\fR(8)
1642 or
1643 \fBpkexec\fR(1), the pager becomes a security boundary\&. Care must be taken that only programs with strictly limited functionality are used as pagers, and unintended interactive features like opening or creation of new files or starting of subprocesses are not allowed\&. "Secure mode" for the pager may be enabled as described below,
1644 \fIif the pager supports that\fR
1645 (most pagers are not written in a way that takes this into consideration)\&. It is recommended to either explicitly enable "secure mode" or to completely disable the pager using
1646 \fB\-\-no\-pager\fR
1647 or
1648 \fIPAGER=cat\fR
1649 when allowing untrusted users to execute commands with elevated privileges\&.
1650 .sp
1651 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
1652 \fBLESSSECURE=1\fR
1653 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses\&. Currently only
1654 \fBless\fR(1)
1655 is known to understand this variable and implement "secure mode"\&.
1656 .sp
1657 When set to false, no limitation is placed on the pager\&. Setting
1658 \fISYSTEMD_PAGERSECURE=0\fR
1659 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
1660 .sp
1661 When
1662 \fI$SYSTEMD_PAGERSECURE\fR
1663 is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it\&. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see
1664 \fBgeteuid\fR(2)
1665 and
1666 \fBsd_pid_get_owner_uid\fR(3), or when running under
1667 \fBsudo\fR(8)
1668 or similar tools (\fI$SUDO_UID\fR
1669 is set
1670 \&\s-2\u[5]\d\s+2)\&. In those cases,
1671 \fISYSTEMD_PAGERSECURE=1\fR
1672 will be set and pagers which are not known to implement "secure mode" will not be used at all\&. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience\&. It is recommended to explicitly set
1673 \fI$SYSTEMD_PAGERSECURE\fR
1674 or disable the pager\&.
1675 .sp
1676 Note that if the
1677 \fI$SYSTEMD_PAGER\fR
1678 or
1679 \fI$PAGER\fR
1680 variables are to be honoured, other than to disable the pager,
1681 \fI$SYSTEMD_PAGERSECURE\fR
1682 must be set too\&.
1683 .RE
1684 .PP
1685 \fI$SYSTEMD_COLORS\fR
1686 .RS 4
1687 Takes a boolean argument, or a special value\&. By default (unset),
1688 \fBsystemd\fR
1689 and related utilities will use colors in their output if possible\&. If
1690 \fI$COLORTERM\fR
1691 is set to
1692 "truecolor"
1693 or
1694 "24bit", 24\-bit colors will be enabled, 256 colors otherwise, unless
1695 \fI$NO_COLOR\fR
1696 or
1697 \fI$TERM\fR
1698 indicates colors are disabled\&.
1699 .PP
1700 \fBtrue\fR
1701 .RS 4
1702 Same as unset, except that
1703 \fI$NO_COLOR\fR
1704 is ignored\&.
1705 .RE
1706 .PP
1707 \fBfalse\fR
1708 .RS 4
1709 The output will be monochrome\&.
1710 .RE
1711 .PP
1712 "16", "256", "24bit"
1713 .RS 4
1714 Always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively\&.
1715 .RE
1716 .PP
1717 "auto\-16", "auto\-256", "auto\-24bit"
1718 .RS 4
1719 Use the given quantity of colours, subject to
1720 \fI$TERM\fR, and what the console is connected to\&.
1721 .RE
1722 .RE
1723 .PP
1724 \fI$SYSTEMD_URLIFY\fR
1725 .RS 4
1726 The value must be a boolean\&. Controls whether clickable links should be generated in the output for terminal emulators supporting this\&. This can be specified to override the decision that
1727 \fBsystemd\fR
1728 makes based on
1729 \fI$TERM\fR
1730 and other conditions\&.
1731 .RE
1732 .SH "EXAMPLES"
1733 .PP
1734 \fBExample\ \&1.\ \&Create a user "waldo" in the administrator group "wheel", and assign 500 MiB disk space to them\&.\fR
1735 .sp
1736 .if n \{\
1737 .RS 4
1738 .\}
1739 .nf
1740 homectl create waldo \-\-real\-name="Waldo McWaldo" \-G wheel \-\-disk\-size=500M
1741 .fi
1742 .if n \{\
1743 .RE
1744 .\}
1745 .PP
1746 \fBExample\ \&2.\ \&Create a user "wally" on a USB stick, and assign a maximum of 500 concurrent tasks to them\&.\fR
1747 .sp
1748 .if n \{\
1749 .RS 4
1750 .\}
1751 .nf
1752 homectl create wally \-\-real\-name="Wally McWally" \-\-image\-path=/dev/disk/by\-id/usb\-SanDisk_Ultra_Fit_476fff954b2b5c44\-0:0 \-\-tasks\-max=500
1753 .fi
1754 .if n \{\
1755 .RE
1756 .\}
1757 .PP
1758 \fBExample\ \&3.\ \&Change nice level of user "odlaw" to +5 and make sure the environment variable \fI$SOME\fR is set to the string "THING" for them on login\&.\fR
1759 .sp
1760 .if n \{\
1761 .RS 4
1762 .\}
1763 .nf
1764 homectl update odlaw \-\-nice=5 \-\-setenv=SOME=THING
1765 .fi
1766 .if n \{\
1767 .RE
1768 .\}
1769 .PP
1770 \fBExample\ \&4.\ \&Set up authentication with a YubiKey security token using PKCS#11/PIV:\fR
1771 .sp
1772 .if n \{\
1773 .RS 4
1774 .\}
1775 .nf
1776 # Clear the Yubikey from any old keys (careful!)
1777 ykman piv reset
1778
1779 # Generate a new private/public key pair on the device, store the public key in \*(Aqpubkey\&.pem\*(Aq\&.
1780 ykman piv generate\-key \-a RSA2048 9d pubkey\&.pem
1781
1782 # Create a self\-signed certificate from this public key, and store it on the device\&.
1783 ykman piv generate\-certificate \-\-subject "Knobelei" 9d pubkey\&.pem
1784
1785 # We do not need the public key on disk anymore
1786 rm pubkey\&.pem
1787
1788 # Allow the security token to unlock the account of user \*(Aqlafcadio\*(Aq\&.
1789 homectl update lafcadio \-\-pkcs11\-token\-uri=auto
1790 .fi
1791 .if n \{\
1792 .RE
1793 .\}
1794 .PP
1795 \fBExample\ \&5.\ \&Set up authentication with a FIDO2 security token:\fR
1796 .sp
1797 .if n \{\
1798 .RS 4
1799 .\}
1800 .nf
1801 # Allow a FIDO2 security token to unlock the account of user \*(Aqnihilbaxter\*(Aq\&.
1802 homectl update nihilbaxter \-\-fido2\-device=auto
1803 .fi
1804 .if n \{\
1805 .RE
1806 .\}
1807 .PP
1808 \fBExample\ \&6.\ \&Add a recovery key to an existing user account:\fR
1809 .sp
1810 .if n \{\
1811 .RS 4
1812 .\}
1813 .nf
1814 # Generate and add a recovery key for user \*(Aqemily\*(Aq\&.
1815 homectl update emily \-\-recovery\-key=yes
1816 .fi
1817 .if n \{\
1818 .RE
1819 .\}
1820 .SH "SEE ALSO"
1821 .PP
1822 \fBsystemd\fR(1), \fBsystemd-homed.service\fR(8), \fBhomed.conf\fR(5), \fBuserdbctl\fR(1), \fBuseradd\fR(8), \fBcryptsetup\fR(8)
1823 .SH "NOTES"
1824 .IP " 1." 4
1825 JSON User Records
1826 .RS 4
1827 \%https://systemd.io/USER_RECORD
1828 .RE
1829 .IP " 2." 4
1830 Icon Naming Specification
1831 .RS 4
1832 \%https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
1833 .RE
1834 .IP " 3." 4
1835 User Record Blob Directories
1836 .RS 4
1837 \%https://systemd.io/USER_RECORD_BLOB_DIRS
1838 .RE
1839 .IP " 4." 4
1840 User/Group Name Syntax
1841 .RS 4
1842 \%https://systemd.io/USER_NAMES
1843 .RE
1844 .IP " 5." 4
1845 It is recommended for other tools to set and check
1846 \fI$SUDO_UID\fR
1847 as appropriate, treating it is a common interface.
1848