Debian Codegraph @

upstream/mageia-cauldron/man1/homectl.1

raw
1 '\" t
2 .TH "HOMECTL" "1" "" "systemd 258.7" "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\-\-match=\fR, \fB\-A\fR, \fB\-N\fR, \fB\-T\fR
260 .RS 4
261 Takes one of
262 "this",
263 "other",
264 "any"
265 or
266 "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
267 "this"
268 is specified the setting will only apply to the local system (positive match), if
269 "other"
270 it will apply to all but the local system (negative match), if
271 "any"
272 it will apply to all systems (unless there\*(Aqs a matching positive or negative per\-machine setting)\&. If
273 "auto"
274 returns to the default logic: whether a setting applies by default to the local system or all systems depends on the option in question\&.
275 .sp
276 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
277 \m[blue]\fBJSON User Records\fR\m[]\&\s-2\u[1]\d\s+2
278 for details on which settings may be used with such per\-machine matching and which ones may not\&.
279 .sp
280 \fB\-A\fR
281 is a shortcut for
282 \fB\-\-match=any\fR,
283 \fB\-T\fR
284 is short for
285 \fB\-\-match=this\fR
286 and
287 \fB\-N\fR
288 is short for
289 \fB\-\-match=other\fR\&.
290 .sp
291 Here\*(Aqs an example call that sets the storage field to
292 "luks"
293 on the local system, but to
294 "cifs"
295 on all others:
296 .sp
297 .if n \{\
298 .RS 4
299 .\}
300 .nf
301 # homectl update lennart \-T \-\-storage=luks \-N \-\-storage=cifs
302 .fi
303 .if n \{\
304 .RE
305 .\}
306 .sp
307 Added in version 258\&.
308 .RE
309 .PP
310 \fB\-H\fR, \fB\-\-host=\fR
311 .RS 4
312 Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
313 "@", to connect to\&. The hostname may optionally be suffixed by a port ssh is listening on, separated by
314 ":", and then a container name, separated by
315 "/", 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
316 \fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&. Put IPv6 addresses in brackets\&.
317 .RE
318 .PP
319 \fB\-M\fR, \fB\-\-machine=\fR
320 .RS 4
321 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
322 "@"
323 character\&. If the special string
324 "\&.host"
325 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:
326 "\-\-user \-\-machine=lennart@\&.host")\&. If the
327 "@"
328 syntax is not used, the connection is made as root user\&. If the
329 "@"
330 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
331 "\&.host"
332 are implied\&.
333 .RE
334 .PP
335 \fB\-\-no\-pager\fR
336 .RS 4
337 Do not pipe output into a pager\&.
338 .RE
339 .PP
340 \fB\-\-no\-legend\fR
341 .RS 4
342 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
343 .RE
344 .PP
345 \fB\-\-no\-ask\-password\fR
346 .RS 4
347 Do not query the user for authentication for privileged operations\&.
348 .RE
349 .PP
350 \fB\-h\fR, \fB\-\-help\fR
351 .RS 4
352 Print a short help text and exit\&.
353 .RE
354 .PP
355 \fB\-\-version\fR
356 .RS 4
357 Print a short version string and exit\&.
358 .RE
359 .SH "GENERAL USER RECORD PROPERTIES"
360 .PP
361 The following options control various properties of the user records/home directories that
362 systemd\-homed\&.service
363 manages\&. These switches may be used in conjunction with the
364 \fBcreate\fR
365 and
366 \fBupdate\fR
367 commands for configuring various aspects of the home directory and the user account:
368 .PP
369 \fB\-\-real\-name=\fR\fB\fINAME\fR\fR, \fB\-c\fR \fINAME\fR
370 .RS 4
371 The real name for the user\&. This corresponds with the GECOS field on classic UNIX NSS records\&.
372 .sp
373 Added in version 245\&.
374 .RE
375 .PP
376 \fB\-\-realm=\fR\fB\fIREALM\fR\fR
377 .RS 4
378 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\&.
379 .sp
380 Added in version 245\&.
381 .RE
382 .PP
383 \fB\-\-alias=\fR\fB\fINAME\fR\fR\fB[,\fINAME\&...\fR]\fR
384 .RS 4
385 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\&.
386 .sp
387 Added in version 258\&.
388 .RE
389 .PP
390 \fB\-\-email\-address=\fR\fB\fIEMAIL\fR\fR
391 .RS 4
392 Takes an electronic mail address to associate with the user\&. On log\-in the
393 \fI$EMAIL\fR
394 environment variable is initialized from this value\&.
395 .sp
396 Added in version 245\&.
397 .RE
398 .PP
399 \fB\-\-location=\fR\fB\fITEXT\fR\fR
400 .RS 4
401 Takes location specification for this user\&. This is free\-form text, which might or might not be usable by geo\-location applications\&. Example:
402 \fB\-\-location="Berlin, Germany"\fR
403 or
404 \fB\-\-location="Basement, Room 3a"\fR
405 .sp
406 Added in version 245\&.
407 .RE
408 .PP
409 \fB\-\-icon\-name=\fR\fB\fIICON\fR\fR
410 .RS 4
411 Takes an icon name to associate with the user, following the scheme defined by the
412 \m[blue]\fBIcon Naming Specification\fR\m[]\&\s-2\u[2]\d\s+2\&.
413 .sp
414 Added in version 245\&.
415 .RE
416 .PP
417 \fB\-\-home\-dir=\fR\fB\fIPATH\fR\fR, \fB\-d\fR\fB\fIPATH\fR\fR
418 .RS 4
419 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
420 \fB\-\-image\-path=\fR
421 for that\&. If not specified, defaults to
422 /home/$USER\&.
423 .sp
424 Added in version 245\&.
425 .RE
426 .PP
427 \fB\-\-uid=\fR\fB\fIUID\fR\fR
428 .RS 4
429 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
430 \fBsystemd\-homed\fR
431 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\&.
432 .sp
433 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
434 \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\&.
435 .sp
436 Note that users managed by
437 \fBsystemd\-homed\fR
438 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\&.
439 .sp
440 Added in version 245\&.
441 .RE
442 .PP
443 \fB\-\-member\-of=\fR\fB\fIGROUP\fR\fR, \fB\-G\fR \fIGROUP\fR
444 .RS 4
445 Takes a comma\-separated list of auxiliary UNIX groups this user shall belong to\&. Example:
446 \fB\-\-member\-of=wheel\fR
447 to provide the user with administrator privileges\&. Note that
448 \fBsystemd\-homed\fR
449 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
450 \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\&.
451 .sp
452 Added in version 245\&.
453 .RE
454 .PP
455 \fB\-\-capability\-bounding\-set=\fR\fB\fICAPABILITIES\fR\fR, \fB\-\-capability\-ambient\-set=\fR\fB\fICAPABILITIES\fR\fR
456 .RS 4
457 These options take a space separated list of process capabilities (e\&.g\&.
458 \fBCAP_WAKE_ALARM\fR,
459 \fBCAP_BLOCK_SUSPEND\fR, \&...) that shall be set in the capability bounding and ambient sets for all the user\*(Aqs sessions\&. See
460 \fBcapabilities\fR(7)
461 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
462 "~"
463 character the effect is inverted: the specified capability is dropped from the specific set\&.
464 .sp
465 Added in version 254\&.
466 .RE
467 .PP
468 \fB\-\-access\-mode=\fR\fB\fIMODE\fR\fR
469 .RS 4
470 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:
471 \fB\-\-access\-mode=0700\fR
472 .sp
473 Added in version 245\&.
474 .RE
475 .PP
476 \fB\-\-umask=\fR\fB\fIMASK\fR\fR
477 .RS 4
478 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\&.
479 .sp
480 Added in version 245\&.
481 .RE
482 .PP
483 \fB\-\-skel=\fR\fB\fIPATH\fR\fR
484 .RS 4
485 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
486 /etc/skel/\&.
487 .sp
488 Added in version 245\&.
489 .RE
490 .PP
491 \fB\-\-shell=\fR\fB\fISHELL\fR\fR
492 .RS 4
493 Takes a file system path\&. Specifies the shell binary to execute on terminal logins\&. If not specified, defaults to
494 /bin/bash\&.
495 .sp
496 Added in version 245\&.
497 .RE
498 .PP
499 \fB\-\-setenv=\fR\fB\fIVARIABLE\fR\fR\fB[=\fR\fB\fIVALUE\fR\fR\fB]\fR
500 .RS 4
501 Takes an environment variable assignment to set for all user processes\&. May be used multiple times to set multiple environment variables\&. When
502 "="
503 and
504 \fIVALUE\fR
505 are omitted, the value of the variable with the same name in the program environment will be used\&.
506 .sp
507 Note that a number of other settings also result in environment variables to be set for the user, including
508 \fB\-\-email=\fR,
509 \fB\-\-timezone=\fR
510 and
511 \fB\-\-language=\fR\&.
512 .sp
513 Added in version 245\&.
514 .RE
515 .PP
516 \fB\-\-timezone=\fR\fB\fITIMEZONE\fR\fR
517 .RS 4
518 Takes a time zone location name that sets the timezone for the specified user\&. When the user logs in the
519 \fI$TZ\fR
520 environment variable is initialized from this setting\&. Example:
521 \fB\-\-timezone=Europe/Amsterdam\fR
522 will result in the environment variable
523 "TZ=:Europe/Amsterdam"\&. (":"
524 is used intentionally as part of the timezone specification, see
525 \fBtzset\fR(3)\&.)
526 .sp
527 Added in version 245\&.
528 .RE
529 .PP
530 \fB\-\-language=\fR\fB\fILANG\fR\fR
531 .RS 4
532 Takes a comma\- or colon\-separated list of languages preferred by the user, ordered by descending priority\&. The
533 \fI$LANG\fR
534 and
535 \fI$LANGUAGE\fR
536 environment variables are initialized from this value on login, and thus values suitable for these environment variables are accepted here, for example
537 \fB\-\-language=de_DE\&.UTF\-8\fR\&. This option may be used more than once, in which case the language lists are concatenated\&.
538 .sp
539 Added in version 245\&.
540 .RE
541 .PP
542 \fB\-\-default\-area=\fR\fB\fIAREA\fR\fR
543 .RS 4
544 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
545 \fI$HOME\fR
546 environment variable is set to
547 ~/Areas/
548 suffixed by the area name\&.
549 .sp
550 For details on the area concept see
551 \fBpam_systemd_home\fR(8)\&. Note that this option just defines the default, which can be overridden at login time\&.
552 .sp
553 When this option is specified with an empty string as value any previously declared default area is removed from the user record\&.
554 .sp
555 Added in version 258\&.
556 .RE
557 .SH "AUTHENTICATION USER RECORD PROPERTIES"
558 .PP
559 \fB\-\-ssh\-authorized\-keys=\fR\fB\fIKEYS\fR\fR
560 .RS 4
561 Either takes a SSH authorized key line to associate with the user record or a
562 "@"
563 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\&.
564 .sp
565 Added in version 245\&.
566 .RE
567 .PP
568 \fB\-\-pkcs11\-token\-uri=\fR\fB\fIURI\fR\fR
569 .RS 4
570 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\&.
571 .sp
572 Instead of a valid PKCS#11 URI, the special strings
573 "list"
574 and
575 "auto"
576 may be specified\&. If
577 "list"
578 is passed, a brief table of suitable, currently plugged in PKCS#11 hardware tokens is shown, along with their URIs\&. If
579 "auto"
580 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\&.
581 .sp
582 Note that many hardware security tokens implement both PKCS#11/PIV and FIDO2 with the
583 "hmac\-secret"
584 extension (for example: the YubiKey 5 series), as supported with the
585 \fB\-\-fido2\-device=\fR
586 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\&.
587 .sp
588 Added in version 245\&.
589 .RE
590 .PP
591 \fB\-\-fido2\-credential\-algorithm=\fR\fB\fISTRING\fR\fR
592 .RS 4
593 Specify COSE algorithm used in credential generation\&. The default value is
594 "es256"\&. Supported values are
595 "es256",
596 "rs256"
597 and
598 "eddsa"\&.
599 .sp
600 "es256"
601 denotes ECDSA over NIST P\-256 with SHA\-256\&.
602 "rs256"
603 denotes 2048\-bit RSA with PKCS#1\&.5 padding and SHA\-256\&.
604 "eddsa"
605 denotes EDDSA over Curve25519 with SHA\-512\&.
606 .sp
607 Note that your authenticator may choose not to support some algorithms\&.
608 .sp
609 Added in version 251\&.
610 .RE
611 .PP
612 \fB\-\-fido2\-device=\fR\fB\fIPATH\fR\fR
613 .RS 4
614 Takes a path to a Linux
615 "hidraw"
616 device (e\&.g\&.
617 /dev/hidraw1), referring to a FIDO2 security token implementing the
618 "hmac\-secret"
619 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\&.
620 .sp
621 Instead of a valid path to a FIDO2
622 "hidraw"
623 device the special strings
624 "list"
625 and
626 "auto"
627 may be specified\&. If
628 "list"
629 is passed, a brief table of suitable discovered FIDO2 devices is shown\&. If
630 "auto"
631 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\&.
632 .sp
633 Note that FIDO2 devices suitable for this option must implement the
634 "hmac\-secret"
635 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\&.
636 .sp
637 The FIDO2 device may be subsequently removed by setting the device path to an empty string (e\&.g\&.
638 \fBhomectl update $USER \-\-fido2\-device=""\fR)\&.
639 .sp
640 Note that many hardware security tokens implement both FIDO2 and PKCS#11/PIV (and thus may be used with either
641 \fB\-\-fido2\-device=\fR
642 or
643 \fB\-\-pkcs11\-token\-uri=\fR), for a discussion see above\&.
644 .sp
645 Added in version 246\&.
646 .RE
647 .PP
648 \fB\-\-fido2\-with\-client\-pin=\fR\fB\fIBOOL\fR\fR
649 .RS 4
650 When enrolling a FIDO2 security token, controls whether to require the user to enter a PIN when unlocking the account (the FIDO2
651 "clientPin"
652 feature)\&. Defaults to
653 "yes"\&. (Note: this setting is without effect if the security token does not support the
654 "clientPin"
655 feature at all, or does not allow enabling or disabling it\&.)
656 .sp
657 Added in version 249\&.
658 .RE
659 .PP
660 \fB\-\-fido2\-with\-user\-presence=\fR\fB\fIBOOL\fR\fR
661 .RS 4
662 When enrolling a FIDO2 security token, controls whether to require the user to verify presence (tap the token, the FIDO2
663 "up"
664 feature) when unlocking the account\&. Defaults to
665 "yes"\&. (Note: this setting is without effect if the security token does not support the
666 "up"
667 feature at all, or does not allow enabling or disabling it\&.)
668 .sp
669 Added in version 249\&.
670 .RE
671 .PP
672 \fB\-\-fido2\-with\-user\-verification=\fR\fB\fIBOOL\fR\fR
673 .RS 4
674 When enrolling a FIDO2 security token, controls whether to require user verification when unlocking the account (the FIDO2
675 "uv"
676 feature)\&. Defaults to
677 "no"\&. (Note: this setting is without effect if the security token does not support the
678 "uv"
679 feature at all, or does not allow enabling or disabling it\&.)
680 .sp
681 Added in version 249\&.
682 .RE
683 .PP
684 \fB\-\-recovery\-key=\fR\fB\fIBOOL\fR\fR
685 .RS 4
686 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\&.
687 .sp
688 Added in version 247\&.
689 .RE
690 .SH "BLOB DIRECTORY USER RECORD PROPERTIES"
691 .PP
692 \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
693 .RS 4
694 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
695 \m[blue]\fBUser Record Blob Directories\fR\m[]\&\s-2\u[3]\d\s+2
696 for more information about blob directories\&.
697 .sp
698 Added in version 256\&.
699 .RE
700 .PP
701 \fB\-\-avatar=\fR\fB\fIPATH\fR\fR, \fB\-\-login\-background=\fR\fB\fIPATH\fR\fR
702 .RS 4
703 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
704 \fB\-\-blob=\fR\fB\fIFILENAME\fR\fR\fB=\fR\fB\fIPATH\fR\fR
705 for the known filenames defined in
706 \m[blue]\fBUser Record Blob Directories\fR\m[]\&\s-2\u[3]\d\s+2\&.
707 .sp
708 Added in version 256\&.
709 .RE
710 .SH "ACCOUNT MANAGEMENT USER RECORD PROPERTIES"
711 .PP
712 \fB\-\-locked=\fR\fB\fIBOOLEAN\fR\fR
713 .RS 4
714 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)\&.
715 .sp
716 Added in version 245\&.
717 .RE
718 .PP
719 \fB\-\-not\-before=\fR\fB\fITIMESTAMP\fR\fR, \fB\-\-not\-after=\fR\fB\fITIMESTAMP\fR\fR
720 .RS 4
721 These options take a timestamp string, in the format documented in
722 \fBsystemd.time\fR(7)
723 and configures points in time before and after logins into this account are not permitted\&.
724 .sp
725 Added in version 245\&.
726 .RE
727 .PP
728 \fB\-\-rate\-limit\-interval=\fR\fB\fISECS\fR\fR, \fB\-\-rate\-limit\-burst=\fR\fB\fINUMBER\fR\fR
729 .RS 4
730 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\&.
731 .sp
732 Added in version 245\&.
733 .RE
734 .PP
735 \fB\-\-password\-hint=\fR\fB\fITEXT\fR\fR
736 .RS 4
737 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:
738 \fB\-\-password\-hint="My first pet\*(Aqs name"\fR\&.
739 .sp
740 Added in version 245\&.
741 .RE
742 .PP
743 \fB\-\-enforce\-password\-policy=\fR\fB\fIBOOL\fR\fR, \fB\-P\fR
744 .RS 4
745 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\&.
746 \fB\-P\fR
747 is short for
748 \fB\-\-enforce\-password\-policy=no\fR\&.
749 .sp
750 Added in version 245\&.
751 .RE
752 .PP
753 \fB\-\-password\-change\-now=\fR\fB\fIBOOL\fR\fR
754 .RS 4
755 Takes a boolean argument\&. If true the user is asked to change their password on next login\&.
756 .sp
757 Added in version 245\&.
758 .RE
759 .PP
760 \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
761 .RS 4
762 Each of these options takes a time span specification as argument (in the syntax documented in
763 \fBsystemd.time\fR(7)) and configures various aspects of the user\*(Aqs password expiration policy\&. Specifically,
764 \fB\-\-password\-change\-min=\fR
765 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\&.
766 \fB\-\-password\-change\-max=\fR
767 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\&.
768 \fB\-\-password\-change\-warn=\fR
769 specifies how much earlier than then the time configured with
770 \fB\-\-password\-change\-max=\fR
771 the user is warned at login to change their password as it will expire soon\&. Finally,
772 \fB\-\-password\-change\-inactive=\fR
773 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\&.
774 .sp
775 Added in version 245\&.
776 .RE
777 .SH "RESOURCE MANAGEMENT USER RECORD PROPERTIES"
778 .PP
779 \fB\-\-disk\-size=\fR\fB\fIBYTES\fR\fR
780 .RS 4
781 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
782 "min"
783 or
784 "max", and configures the disk space to assign to the user\&. If a percentage value is specified (i\&.e\&. the argument suffixed with
785 "%") it is taken relative to the available disk space of the backing file system\&. If specified as
786 "min"
787 assigns the minimal disk space permitted by the constraints of the backing file system and other limits, when specified as
788 "max"
789 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\&.
790 .sp
791 Added in version 245\&.
792 .RE
793 .PP
794 \fB\-\-nice=\fR\fB\fINICE\fR\fR
795 .RS 4
796 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)\&.
797 .sp
798 Added in version 245\&.
799 .RE
800 .PP
801 \fB\-\-rlimit=\fR\fB\fILIMIT\fR\fR\fB=\fR\fB\fIVALUE\fR\fR\fB[:\fIVALUE\fR]\fR
802 .RS 4
803 Allows configuration of resource limits for processes of this user, see
804 \fBgetrlimit\fR(2)
805 for details\&. Takes a resource limit name (e\&.g\&.
806 "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\&.
807 .sp
808 Added in version 245\&.
809 .RE
810 .PP
811 \fB\-\-tasks\-max=\fR\fB\fITASKS\fR\fR
812 .RS 4
813 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
814 \fBsu\fR(1)
815 or a similar tool\&. Use
816 \fB\-\-rlimit=LIMIT_NPROC=\fR
817 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
818 \fITasksMax=\fR
819 setting of the per\-user systemd slice unit
820 user\-$UID\&.slice\&. See
821 \fBsystemd.resource-control\fR(5)
822 for further details\&.
823 .sp
824 Added in version 245\&.
825 .RE
826 .PP
827 \fB\-\-memory\-high=\fR\fB\fIBYTES\fR\fR, \fB\-\-memory\-max=\fR\fB\fIBYTES\fR\fR
828 .RS 4
829 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
830 \fIMemoryHigh=\fR
831 and
832 \fIMemoryMax=\fR
833 settings of the per\-user systemd slice unit
834 user\-$UID\&.slice\&. See
835 \fBsystemd.resource-control\fR(5)
836 for further details\&.
837 .sp
838 Added in version 245\&.
839 .RE
840 .PP
841 \fB\-\-cpu\-weight=\fR\fB\fIWEIGHT\fR\fR, \fB\-\-io\-weight=\fR\fB\fIWEIGHT\fR\fR
842 .RS 4
843 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
844 \fICPUWeight=\fR
845 and
846 \fIIOWeight=\fR
847 settings of the per\-user systemd slice unit
848 user\-$UID\&.slice\&. See
849 \fBsystemd.resource-control\fR(5)
850 for further details\&.
851 .sp
852 Added in version 245\&.
853 .RE
854 .SH "STORAGE USER RECORD PROPERTIES"
855 .PP
856 \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
857 .RS 4
858 Controls the per\-user quota on
859 /tmp/
860 and
861 /dev/shm/
862 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
863 "tmpfs"
864 and has no effect otherwise\&. Note that if these options are not used, a default quota might still be enforced (typically 80%\&.)
865 .sp
866 Added in version 258\&.
867 .RE
868 .PP
869 \fB\-\-storage=\fR\fB\fISTORAGE\fR\fR
870 .RS 4
871 Selects the storage mechanism to use for this home directory\&. Takes one of
872 "luks",
873 "fscrypt",
874 "directory",
875 "subvolume",
876 "cifs"\&. For details about these mechanisms, see above\&. If a new home directory is created and the storage type is not specifically specified,
877 \fBhomed.conf\fR(5)
878 defines which default storage to use\&.
879 .sp
880 Added in version 245\&.
881 .RE
882 .PP
883 \fB\-\-image\-path=\fR\fB\fIPATH\fR\fR
884 .RS 4
885 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
886 /home/
887 or any other accessible filesystem)\&. When unspecified defaults to
888 /home/$USER\&.home
889 when LUKS storage is used and
890 /home/$USER\&.homedir
891 for the other storage mechanisms\&. Not defined for the
892 "cifs"
893 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\&.
894 .sp
895 Added in version 245\&.
896 .RE
897 .PP
898 \fB\-\-drop\-caches=\fR\fB\fIBOOL\fR\fR
899 .RS 4
900 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\&.
901 .sp
902 Added in version 250\&.
903 .RE
904 .SH "LUKS STORAGE USER RECORD PROPERTIES"
905 .PP
906 \fB\-\-fs\-type=\fR\fB\fITYPE\fR\fR
907 .RS 4
908 When LUKS2 storage is used configures the file system type to use inside the home directory LUKS2 container\&. One of
909 "btrfs",
910 "ext4",
911 "xfs"\&. If not specified
912 \fBhomed.conf\fR(5)
913 defines which default file system type to use\&. Note that
914 "xfs"
915 is not recommended as its support for file system resizing is too limited\&.
916 .sp
917 Added in version 245\&.
918 .RE
919 .PP
920 \fB\-\-luks\-discard=\fR\fB\fIBOOL\fR\fR
921 .RS 4
922 When LUKS2 storage is used configures whether to enable the
923 "discard"
924 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\&.
925 .sp
926 Added in version 245\&.
927 .RE
928 .PP
929 \fB\-\-luks\-offline\-discard=\fR\fB\fIBOOL\fR\fR
930 .RS 4
931 Similar to
932 \fB\-\-luks\-discard=\fR, controls the trimming of the file system\&. However, while
933 \fB\-\-luks\-discard=\fR
934 controls what happens when the home directory is active,
935 \fB\-\-luks\-offline\-discard=\fR
936 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\&.
937 .sp
938 Added in version 246\&.
939 .RE
940 .PP
941 \fB\-\-luks\-extra\-mount\-options=\fR\fB\fIOPTIONS\fR\fR
942 .RS 4
943 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"\&.
944 .sp
945 Added in version 250\&.
946 .RE
947 .PP
948 \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
949 .RS 4
950 Configures various cryptographic parameters for the LUKS2 storage mechanism\&. See
951 \fBcryptsetup\fR(8)
952 for details on the specific attributes\&.
953 .sp
954 Note that
955 \fBhomectl\fR
956 uses bytes for key size, like
957 /proc/crypto, but
958 \fBcryptsetup\fR(8)
959 uses bits\&.
960 .sp
961 Added in version 245\&.
962 .RE
963 .PP
964 \fB\-\-auto\-resize\-mode=\fR
965 .RS 4
966 Configures whether to automatically grow and/or shrink the backing file system on login and logout\&. Takes one of the strings
967 "off",
968 "grow",
969 "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
970 "shrink\-and\-grow", if LUKS2/btrfs is used, otherwise is off\&. If set to
971 "off"
972 no automatic shrinking/growing during login or logout is done\&. If set to
973 "grow"
974 the home area is grown to the size configured via
975 \fB\-\-disk\-size=\fR
976 should it currently be smaller\&. If it already matches the configured size or is larger no operation is executed\&. If set to
977 "shrink\-and\-grow"
978 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\&.
979 .sp
980 Added in version 250\&.
981 .RE
982 .PP
983 \fB\-\-rebalance\-weight=\fR
984 .RS 4
985 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
986 "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
987 "off"
988 no automatic free space distribution is done for this home area\&. Note that resizing the home area explicitly (with
989 \fBhomectl resize\fR
990 see below) will implicitly turn off the automatic rebalancing\&. To reenable the automatic rebalancing use
991 \fB\-\-rebalance\-weight=\fR
992 with an empty parameter\&.
993 .sp
994 Added in version 250\&.
995 .RE
996 .SH "MOUNTING USER RECORD PROPERTIES"
997 .PP
998 \fB\-\-nosuid=\fR\fB\fIBOOL\fR\fR, \fB\-\-nodev=\fR\fB\fIBOOL\fR\fR, \fB\-\-noexec=\fR\fB\fIBOOL\fR\fR
999 .RS 4
1000 Configures the
1001 "nosuid",
1002 "nodev"
1003 and
1004 "noexec"
1005 mount options for the home directories\&. By default,
1006 "nodev"
1007 and
1008 "nosuid"
1009 are on, while
1010 "noexec"
1011 is off\&. For details about these mount options see
1012 \fBmount\fR(8)\&.
1013 .sp
1014 Added in version 245\&.
1015 .RE
1016 .SH "CIFS USER RECORD PROPERTIES"
1017 .PP
1018 \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
1019 .RS 4
1020 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
1021 "cifs"
1022 storage is selected\&. The file share should be specified in format
1023 "//\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
1024 \fB\-\-cifs\-extra\-mount\-options=\fR
1025 setting allows specifying additional mount options when mounting the share, see
1026 \fBmount.cifs\fR(8)
1027 for details\&.
1028 .sp
1029 Added in version 245\&.
1030 .RE
1031 .SH "LOGIN BEHAVIOUR RECORD PROPERTIES"
1032 .PP
1033 \fB\-\-stop\-delay=\fR\fB\fISECS\fR\fR
1034 .RS 4
1035 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
1036 \fBlogind.conf\fR(5)
1037 (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\&.
1038 .sp
1039 Added in version 245\&.
1040 .RE
1041 .PP
1042 \fB\-\-kill\-processes=\fR\fB\fIBOOL\fR\fR
1043 .RS 4
1044 Configures whether to kill all processes of the user on logout\&. The default is configured in
1045 \fBlogind.conf\fR(5)\&.
1046 .sp
1047 Added in version 245\&.
1048 .RE
1049 .PP
1050 \fB\-\-auto\-login=\fR\fB\fIBOOL\fR\fR
1051 .RS 4
1052 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\&.
1053 .sp
1054 Added in version 245\&.
1055 .RE
1056 .PP
1057 \fB\-\-session\-launcher=\fR\fB\fILAUNCHER\fR\fR
1058 .RS 4
1059 Takes a string argument\&. Configures the user\*(Aqs preferred session launcher \&.desktop entry file (i\&.e\&.
1060 "gnome",
1061 "plasma", or other names that appear in
1062 /usr/share/xesssions/
1063 or
1064 /usr/share/wayland\-sessions)\&. This is read by the display manager to pick the default session that is launched when the user logs in\&.
1065 .sp
1066 Added in version 256\&.
1067 .RE
1068 .PP
1069 \fB\-\-session\-type=\fR\fB\fITYPE\fR\fR
1070 .RS 4
1071 Takes a string argument\&. Configures the user\*(Aqs preferred session type (i\&.e\&.
1072 "x11",
1073 "wayland", and other values accepted by
1074 \fI$XDG_SESSION_TYPE\fR)\&. This is read by the display manage to pick the default session type the user is logged into\&.
1075 .sp
1076 Added in version 256\&.
1077 .RE
1078 .SH "COMMANDS"
1079 .PP
1080 The following commands are understood:
1081 .PP
1082 \fBlist\fR
1083 .RS 4
1084 List all home directories (along with brief details) currently managed by
1085 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
1086 /etc/passwd\&.)
1087 .sp
1088 Added in version 245\&.
1089 .RE
1090 .PP
1091 \fBactivate\fR \fIUSER\fR [\fIUSER\&...\fR]
1092 .RS 4
1093 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
1094 /home/$USER)\&. Note that any home activated this way stays active indefinitely, until it is explicitly deactivated again (with
1095 \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\&.
1096 .sp
1097 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\&.
1098 .sp
1099 Added in version 245\&.
1100 .RE
1101 .PP
1102 \fBdeactivate\fR \fIUSER\fR [\fIUSER\&...\fR]
1103 .RS 4
1104 Deactivate one or more home directories\&. This undoes the effect of
1105 \fBactivate\fR\&.
1106 .sp
1107 Added in version 245\&.
1108 .RE
1109 .PP
1110 \fBinspect\fR \fIUSER\fR [\fIUSER\&...\fR]
1111 .RS 4
1112 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
1113 \fB\-\-json=\fR
1114 to show the detailed JSON user record instead, possibly combined with
1115 \fB\-\-export\-format=\fR
1116 to suppress certain aspects of the output\&.
1117 .sp
1118 Added in version 245\&.
1119 .RE
1120 .PP
1121 \fBauthenticate\fR \fIUSER\fR [\fIUSER\&...\fR]
1122 .RS 4
1123 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\&.
1124 .sp
1125 Added in version 245\&.
1126 .RE
1127 .PP
1128 \fBcreate\fR \fIUSER\fR, \fBcreate\fR \fB\-\-identity=\fR\fB\fIPATH\fR\fR [\fIUSER\fR]
1129 .RS 4
1130 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\&.
1131 .sp
1132 The specified user name should follow the strict syntax described on
1133 \m[blue]\fBUser/Group Name Syntax\fR\m[]\&\s-2\u[4]\d\s+2\&.
1134 .sp
1135 Added in version 245\&.
1136 .RE
1137 .PP
1138 \fBadopt\fR \fIPATH\fR [\fIPATH\fR\&...]
1139 .RS 4
1140 Adopts one or more existing home directories on the local system\&. Takes one or more paths to
1141 *\&.home
1142 LUKS home directories or
1143 *\&.homedir/
1144 standalone home directories or subvolumes previously created by
1145 systemd\-homed
1146 and makes them available locally for login\&. The referenced files are not moved\&. This is an alternative for moving such home directories into
1147 /home/
1148 (where they would be picked up automatically)\&.
1149 .sp
1150 Added in version 258\&.
1151 .RE
1152 .PP
1153 \fBregister\fR \fIFILE\fR [\fIFILE\fR\&...]
1154 .RS 4
1155 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
1156 "\-"
1157 reads the JSON user record from standard input\&.
1158 .sp
1159 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\&.
1160 .sp
1161 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
1162 "root":
1163 .sp
1164 .if n \{\
1165 .RS 4
1166 .\}
1167 .nf
1168 # smbpasswd \-a lennart
1169 .fi
1170 .if n \{\
1171 .RE
1172 .\}
1173 .sp
1174 Continue as regular user
1175 "lennart":
1176 .sp
1177 .if n \{\
1178 .RS 4
1179 .\}
1180 .nf
1181 $ homectl update lennart \-\-ssh\-authorized\-keys=\&... \-N \-\-storage=cifs \-\-cifs\-service="//$HOSTNAME/lennart"
1182 $ homectl get\-signing\-key | ssh targetsystem homectl add\-signing\-key \-\-key\-name="$HOSTNAME"\&.public
1183 $ homectl inspect \-E lennart | ssh targetsystem homectl register \-
1184 $ ssh lennart@targetsystem
1185 .fi
1186 .if n \{\
1187 .RE
1188 .\}
1189 .sp
1190 This first ensures the user account
1191 "lennart"
1192 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\&.
1193 .sp
1194 Added in version 258\&.
1195 .RE
1196 .PP
1197 \fBunregister\fR \fIUSER\fR\&...
1198 .RS 4
1199 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
1200 \fBregister\fR
1201 or
1202 \fBadopt\fR
1203 command later, on this or another system\&. Note that unregistering a user whose home directory is placed in
1204 /home/
1205 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\&.
1206 .sp
1207 Added in version 258\&.
1208 .RE
1209 .PP
1210 \fBremove\fR \fIUSER\fR
1211 .RS 4
1212 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\&.
1213 .sp
1214 Added in version 245\&.
1215 .RE
1216 .PP
1217 \fBupdate\fR \fIUSER\fR, \fBupdate\fR \fB\-\-identity=\fR\fB\fIPATH\fR\fR [\fIUSER\fR]
1218 .RS 4
1219 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
1220 \fB\-\-identity=\fR
1221 option\&.
1222 .sp
1223 Note that changes to user records not signed by a cryptographic private key available locally are not permitted, unless
1224 \fB\-\-identity=\fR
1225 is used with a user record that is already correctly signed by a recognized private key\&.
1226 .sp
1227 Added in version 245\&.
1228 .RE
1229 .PP
1230 \fBpasswd\fR \fIUSER\fR
1231 .RS 4
1232 Change the password of the specified home directory/user account\&.
1233 .sp
1234 Added in version 245\&.
1235 .RE
1236 .PP
1237 \fBresize\fR \fIUSER\fR \fIBYTES\fR
1238 .RS 4
1239 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
1240 "ext4"
1241 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
1242 "xfs"
1243 is used inside of the LUKS2 volume the home directory may not be shrunk whatsoever\&. On all three of
1244 "ext4",
1245 "xfs"
1246 and
1247 "btrfs"
1248 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
1249 "subvolume",
1250 "directory",
1251 "fscrypt"
1252 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
1253 "min"
1254 and
1255 "max"
1256 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\&.
1257 .sp
1258 Added in version 245\&.
1259 .RE
1260 .PP
1261 \fBlock\fR \fIUSER\fR
1262 .RS 4
1263 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\&.
1264 .sp
1265 Added in version 245\&.
1266 .RE
1267 .PP
1268 \fBunlock\fR \fIUSER\fR
1269 .RS 4
1270 Resume access to the user\*(Aqs home directory again, undoing the effect of
1271 \fBlock\fR
1272 above\&. This requires authentication of the user, as the cryptographic keys required for access to the home directory need to be reacquired\&.
1273 .sp
1274 Added in version 245\&.
1275 .RE
1276 .PP
1277 \fBlock\-all\fR
1278 .RS 4
1279 Execute the
1280 \fBlock\fR
1281 command on all suitable home directories at once\&. This operation is generally executed on system suspend (i\&.e\&. by
1282 \fBsystemctl suspend\fR
1283 and related commands), to ensure all active user\*(Aqs cryptographic keys for accessing their home directories are removed from memory\&.
1284 .sp
1285 Added in version 245\&.
1286 .RE
1287 .PP
1288 \fBdeactivate\-all\fR
1289 .RS 4
1290 Execute the
1291 \fBdeactivate\fR
1292 command on all active home directories at once\&. This operation is generally executed on system shut down (i\&.e\&. by
1293 \fBsystemctl poweroff\fR
1294 and related commands), to ensure all active user\*(Aqs home directories are fully deactivated before
1295 /home/
1296 and related file systems are unmounted\&.
1297 .sp
1298 Added in version 247\&.
1299 .RE
1300 .PP
1301 \fBwith\fR \fIUSER\fR \fICOMMAND\&...\fR
1302 .RS 4
1303 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\&.
1304 .sp
1305 Added in version 245\&.
1306 .RE
1307 .PP
1308 \fBrebalance\fR
1309 .RS 4
1310 Rebalance free disk space between active home areas and the backing storage\&. See
1311 \fB\-\-rebalance\-weight=\fR
1312 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\&.
1313 .sp
1314 Added in version 250\&.
1315 .RE
1316 .PP
1317 \fBfirstboot\fR
1318 .RS 4
1319 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
1320 \fB\-\-prompt\-new\-user\fR
1321 is specified)\&. Alternatively, if one or more service credentials whose name starts with
1322 "home\&.create\&."
1323 are passed to the command (containing a user record in JSON format) these users are automatically created at boot\&.
1324 .sp
1325 This command is invoked by the
1326 systemd\-homed\-firstboot\&.service
1327 service unit\&.
1328 .sp
1329 Added in version 256\&.
1330 .RE
1331 .PP
1332 \fBlist\-signing\-keys\fR
1333 .RS 4
1334 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
1335 \fBadd\-signing\-key\fR
1336 below)\&.
1337 .sp
1338 Added in version 258\&.
1339 .RE
1340 .PP
1341 \fBget\-signing\-key\fR [\fINAME\&...\fR]
1342 .RS 4
1343 Write the public key identified by the specified name to standard output (in PEM format)\&. If no name is specified defaults to
1344 local\&.public, i\&.e\&. the automatically generated key for locally created home directories\&.
1345 .sp
1346 Added in version 258\&.
1347 .RE
1348 .PP
1349 \fBadd\-signing\-key\fR [\fIFILE\&...\fR]
1350 .RS 4
1351 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
1352 "\-"
1353 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
1354 \&.public
1355 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
1356 \fB\-\-key\-name=\fR, see above\&.
1357 .sp
1358 This command is useful for permitting local home directories to be used on a remote system\&. Example:
1359 .sp
1360 .if n \{\
1361 .RS 4
1362 .\}
1363 .nf
1364 homectl get\-signing\-key | ssh myotherhost homectl add\-signing\-key \-\-key\-name="$HOSTNAME"\&.public
1365 .fi
1366 .if n \{\
1367 .RE
1368 .\}
1369 .sp
1370 Added in version 258\&.
1371 .RE
1372 .PP
1373 \fBremove\-signing\-key\fR \fINAME\&...\fR
1374 .RS 4
1375 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\&.
1376 .sp
1377 Added in version 258\&.
1378 .RE
1379 .SH "CREDENTIALS"
1380 .PP
1381 When invoked with the
1382 \fBfirstboot\fR
1383 command,
1384 \fBhomectl\fR
1385 supports the service credentials logic as implemented by
1386 \fIImportCredential=\fR/\fILoadCredential=\fR/\fISetCredential=\fR
1387 (see
1388 \fBsystemd.exec\fR(5)
1389 for details)\&. The following credentials are used when passed in:
1390 .PP
1391 \fIhome\&.create\&.*\fR
1392 .RS 4
1393 If one or more credentials whose names begin with
1394 "home\&.create\&.", followed by a valid UNIX username are passed, a new home area is created, one for each specified user record\&.
1395 .sp
1396 Added in version 256\&.
1397 .RE
1398 .SH "KERNEL COMMAND LINE"
1399 .PP
1400 \fIsystemd\&.firstboot=\fR
1401 .RS 4
1402 This boolean will disable the effect of
1403 \fBhomectl firstboot\fR
1404 command\&. It\*(Aqs primarily interpreted by
1405 \fBsystemd-firstboot\fR(1)\&.
1406 .sp
1407 Added in version 256\&.
1408 .RE
1409 .SH "EXIT STATUS"
1410 .PP
1411 On success, 0 is returned, a non\-zero failure code otherwise\&.
1412 .PP
1413 When a command is invoked with
1414 \fBwith\fR, the exit status of the child is propagated\&. Effectively,
1415 \fBhomectl\fR
1416 will exit without error if the command is successfully invoked
1417 \fIand\fR
1418 finishes successfully\&.
1419 .SH "ENVIRONMENT"
1420 .PP
1421 \fI$SYSTEMD_LOG_LEVEL\fR
1422 .RS 4
1423 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)
1424 \fBemerg\fR,
1425 \fBalert\fR,
1426 \fBcrit\fR,
1427 \fBerr\fR,
1428 \fBwarning\fR,
1429 \fBnotice\fR,
1430 \fBinfo\fR,
1431 \fBdebug\fR, or an integer in the range 0\&...7\&. See
1432 \fBsyslog\fR(3)
1433 for more information\&. Each value may optionally be prefixed with one of
1434 \fBconsole\fR,
1435 \fBsyslog\fR,
1436 \fBkmsg\fR
1437 or
1438 \fBjournal\fR
1439 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
1440 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
1441 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\&.
1442 .RE
1443 .PP
1444 \fI$SYSTEMD_LOG_COLOR\fR
1445 .RS 4
1446 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
1447 .sp
1448 This setting is only useful when messages are written directly to the terminal, because
1449 \fBjournalctl\fR(1)
1450 and other tools that display logs will color messages based on the log level on their own\&.
1451 .RE
1452 .PP
1453 \fI$SYSTEMD_LOG_TIME\fR
1454 .RS 4
1455 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
1456 .sp
1457 This setting is only useful when messages are written directly to the terminal or a file, because
1458 \fBjournalctl\fR(1)
1459 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
1460 .RE
1461 .PP
1462 \fI$SYSTEMD_LOG_LOCATION\fR
1463 .RS 4
1464 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
1465 .sp
1466 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\&.
1467 .RE
1468 .PP
1469 \fI$SYSTEMD_LOG_TID\fR
1470 .RS 4
1471 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
1472 .sp
1473 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\&.
1474 .RE
1475 .PP
1476 \fI$SYSTEMD_LOG_TARGET\fR
1477 .RS 4
1478 The destination for log messages\&. One of
1479 \fBconsole\fR
1480 (log to the attached tty),
1481 \fBconsole\-prefixed\fR
1482 (log to the attached tty but with prefixes encoding the log level and "facility", see
1483 \fBsyslog\fR(3),
1484 \fBkmsg\fR
1485 (log to the kernel circular log buffer),
1486 \fBjournal\fR
1487 (log to the journal),
1488 \fBjournal\-or\-kmsg\fR
1489 (log to the journal if available, and to kmsg otherwise),
1490 \fBauto\fR
1491 (determine the appropriate log target automatically, the default),
1492 \fBnull\fR
1493 (disable log output)\&.
1494 .RE
1495 .PP
1496 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
1497 .RS 4
1498 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
1499 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
1500 .RE
1501 .PP
1502 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
1503 .RS 4
1504 Pager to use when
1505 \fB\-\-no\-pager\fR
1506 is not given\&.
1507 \fI$SYSTEMD_PAGER\fR
1508 is used if set; otherwise
1509 \fI$PAGER\fR
1510 is used\&. If neither
1511 \fI$SYSTEMD_PAGER\fR
1512 nor
1513 \fI$PAGER\fR
1514 are set, a set of well\-known pager implementations is tried in turn, including
1515 \fBless\fR(1)
1516 and
1517 \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
1518 "cat"
1519 is equivalent to passing
1520 \fB\-\-no\-pager\fR\&.
1521 .sp
1522 Note: if
1523 \fI$SYSTEMD_PAGERSECURE\fR
1524 is not set,
1525 \fI$SYSTEMD_PAGER\fR
1526 and
1527 \fI$PAGER\fR
1528 can only be used to disable the pager (with
1529 "cat"
1530 or
1531 ""), and are otherwise ignored\&.
1532 .RE
1533 .PP
1534 \fI$SYSTEMD_LESS\fR
1535 .RS 4
1536 Override the options passed to
1537 \fBless\fR
1538 (by default
1539 "FRSXMK")\&.
1540 .sp
1541 Users might want to change two options in particular:
1542 .PP
1543 \fBK\fR
1544 .RS 4
1545 This option instructs the pager to exit immediately when
1546 Ctrl+C
1547 is pressed\&. To allow
1548 \fBless\fR
1549 to handle
1550 Ctrl+C
1551 itself to switch back to the pager command prompt, unset this option\&.
1552 .sp
1553 If the value of
1554 \fI$SYSTEMD_LESS\fR
1555 does not include
1556 "K", and the pager that is invoked is
1557 \fBless\fR,
1558 Ctrl+C
1559 will be ignored by the executable, and needs to be handled by the pager\&.
1560 .RE
1561 .PP
1562 \fBX\fR
1563 .RS 4
1564 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\&.
1565 .RE
1566 .sp
1567 Note that setting the regular
1568 \fI$LESS\fR
1569 environment variable has no effect for
1570 \fBless\fR
1571 invocations by systemd tools\&.
1572 .sp
1573 See
1574 \fBless\fR(1)
1575 for more discussion\&.
1576 .RE
1577 .PP
1578 \fI$SYSTEMD_LESSCHARSET\fR
1579 .RS 4
1580 Override the charset passed to
1581 \fBless\fR
1582 (by default
1583 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
1584 .sp
1585 Note that setting the regular
1586 \fI$LESSCHARSET\fR
1587 environment variable has no effect for
1588 \fBless\fR
1589 invocations by systemd tools\&.
1590 .RE
1591 .PP
1592 \fI$SYSTEMD_PAGERSECURE\fR
1593 .RS 4
1594 Common pager commands like
1595 \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
1596 \fBsudo\fR(8)
1597 or
1598 \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,
1599 \fIif the pager supports that\fR
1600 (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
1601 \fB\-\-no\-pager\fR
1602 or
1603 \fIPAGER=cat\fR
1604 when allowing untrusted users to execute commands with elevated privileges\&.
1605 .sp
1606 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
1607 \fBLESSSECURE=1\fR
1608 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
1609 \fBless\fR(1)
1610 is known to understand this variable and implement "secure mode"\&.
1611 .sp
1612 When set to false, no limitation is placed on the pager\&. Setting
1613 \fISYSTEMD_PAGERSECURE=0\fR
1614 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
1615 .sp
1616 When
1617 \fI$SYSTEMD_PAGERSECURE\fR
1618 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
1619 \fBgeteuid\fR(2)
1620 and
1621 \fBsd_pid_get_owner_uid\fR(3), or when running under
1622 \fBsudo\fR(8)
1623 or similar tools (\fI$SUDO_UID\fR
1624 is set
1625 \&\s-2\u[5]\d\s+2)\&. In those cases,
1626 \fISYSTEMD_PAGERSECURE=1\fR
1627 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
1628 \fI$SYSTEMD_PAGERSECURE\fR
1629 or disable the pager\&.
1630 .sp
1631 Note that if the
1632 \fI$SYSTEMD_PAGER\fR
1633 or
1634 \fI$PAGER\fR
1635 variables are to be honoured, other than to disable the pager,
1636 \fI$SYSTEMD_PAGERSECURE\fR
1637 must be set too\&.
1638 .RE
1639 .PP
1640 \fI$SYSTEMD_COLORS\fR
1641 .RS 4
1642 Takes a boolean argument\&. When true,
1643 \fBsystemd\fR
1644 and related utilities will use colors in their output, otherwise the output will be monochrome\&. Additionally, the variable can take one of the following special values:
1645 "16",
1646 "256"
1647 to restrict the use of colors to the base 16 or 256 ANSI colors, respectively\&. This can be specified to override the automatic decision based on
1648 \fI$TERM\fR
1649 and what the console is connected to\&.
1650 .RE
1651 .PP
1652 \fI$SYSTEMD_URLIFY\fR
1653 .RS 4
1654 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
1655 \fBsystemd\fR
1656 makes based on
1657 \fI$TERM\fR
1658 and other conditions\&.
1659 .RE
1660 .SH "EXAMPLES"
1661 .PP
1662 \fBExample\ \&1.\ \&Create a user "waldo" in the administrator group "wheel", and assign 500 MiB disk space to them\&.\fR
1663 .sp
1664 .if n \{\
1665 .RS 4
1666 .\}
1667 .nf
1668 homectl create waldo \-\-real\-name="Waldo McWaldo" \-G wheel \-\-disk\-size=500M
1669 .fi
1670 .if n \{\
1671 .RE
1672 .\}
1673 .PP
1674 \fBExample\ \&2.\ \&Create a user "wally" on a USB stick, and assign a maximum of 500 concurrent tasks to them\&.\fR
1675 .sp
1676 .if n \{\
1677 .RS 4
1678 .\}
1679 .nf
1680 homectl create wally \-\-real\-name="Wally McWally" \-\-image\-path=/dev/disk/by\-id/usb\-SanDisk_Ultra_Fit_476fff954b2b5c44\-0:0 \-\-tasks\-max=500
1681 .fi
1682 .if n \{\
1683 .RE
1684 .\}
1685 .PP
1686 \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
1687 .sp
1688 .if n \{\
1689 .RS 4
1690 .\}
1691 .nf
1692 homectl update odlaw \-\-nice=5 \-\-setenv=SOME=THING
1693 .fi
1694 .if n \{\
1695 .RE
1696 .\}
1697 .PP
1698 \fBExample\ \&4.\ \&Set up authentication with a YubiKey security token using PKCS#11/PIV:\fR
1699 .sp
1700 .if n \{\
1701 .RS 4
1702 .\}
1703 .nf
1704 # Clear the Yubikey from any old keys (careful!)
1705 ykman piv reset
1706
1707 # Generate a new private/public key pair on the device, store the public key in \*(Aqpubkey\&.pem\*(Aq\&.
1708 ykman piv generate\-key \-a RSA2048 9d pubkey\&.pem
1709
1710 # Create a self\-signed certificate from this public key, and store it on the device\&.
1711 ykman piv generate\-certificate \-\-subject "Knobelei" 9d pubkey\&.pem
1712
1713 # We do not need the public key on disk anymore
1714 rm pubkey\&.pem
1715
1716 # Allow the security token to unlock the account of user \*(Aqlafcadio\*(Aq\&.
1717 homectl update lafcadio \-\-pkcs11\-token\-uri=auto
1718 .fi
1719 .if n \{\
1720 .RE
1721 .\}
1722 .PP
1723 \fBExample\ \&5.\ \&Set up authentication with a FIDO2 security token:\fR
1724 .sp
1725 .if n \{\
1726 .RS 4
1727 .\}
1728 .nf
1729 # Allow a FIDO2 security token to unlock the account of user \*(Aqnihilbaxter\*(Aq\&.
1730 homectl update nihilbaxter \-\-fido2\-device=auto
1731 .fi
1732 .if n \{\
1733 .RE
1734 .\}
1735 .SH "SEE ALSO"
1736 .PP
1737 \fBsystemd\fR(1), \fBsystemd-homed.service\fR(8), \fBhomed.conf\fR(5), \fBuserdbctl\fR(1), \fBuseradd\fR(8), \fBcryptsetup\fR(8)
1738 .SH "NOTES"
1739 .IP " 1." 4
1740 JSON User Records
1741 .RS 4
1742 \%https://systemd.io/USER_RECORD
1743 .RE
1744 .IP " 2." 4
1745 Icon Naming Specification
1746 .RS 4
1747 \%https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
1748 .RE
1749 .IP " 3." 4
1750 User Record Blob Directories
1751 .RS 4
1752 \%https://systemd.io/USER_RECORD_BLOB_DIRS
1753 .RE
1754 .IP " 4." 4
1755 User/Group Name Syntax
1756 .RS 4
1757 \%https://systemd.io/USER_NAMES
1758 .RE
1759 .IP " 5." 4
1760 It is recommended for other tools to set and check
1761 \fI$SUDO_UID\fR
1762 as appropriate, treating it is a common interface.
1763