Debian Codegraph @

upstream/debian-unstable/man1/userdbctl.1

raw
1 '\" t
2 .TH "USERDBCTL" "1" "" "systemd 261~rc3" "userdbctl"
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 userdbctl \- Inspect users, groups and group memberships
24 .SH "SYNOPSIS"
25 .HP \w'\fBuserdbctl\fR\ 'u
26 \fBuserdbctl\fR [OPTIONS...] {COMMAND} [NAME...]
27 .SH "DESCRIPTION"
28 .PP
29 \fBuserdbctl\fR
30 may be used to inspect user and groups (as well as group memberships) of the system\&. This client utility inquires user/group information provided by various system services, both operating on JSON user/group records (as defined by the
31 \m[blue]\fBJSON User Records\fR\m[]\&\s-2\u[1]\d\s+2
32 and
33 \m[blue]\fBJSON Group Records\fR\m[]\&\s-2\u[2]\d\s+2
34 definitions), and classic UNIX NSS/glibc user and group records\&. This tool is primarily a client to the
35 \m[blue]\fBUser/Group Record Lookup API via Varlink\fR\m[]\&\s-2\u[3]\d\s+2, and may also pick up drop\-in JSON user and group records from
36 /etc/userdb/,
37 /run/userdb/,
38 /run/host/userdb/,
39 /usr/lib/userdb/
40 (see
41 \fBnss-systemd\fR(8)
42 for details about drop\-in user records)\&.
43 .SH "OPTIONS"
44 .PP
45 The following options are understood:
46 .PP
47 \fB\-\-output=\fR\fB\fIMODE\fR\fR
48 .RS 4
49 Chooses the output mode\&. Takes one of
50 "classic",
51 "friendly",
52 "table"
53 or
54 "json"\&. If
55 "classic", an output very close to the format of
56 /etc/passwd
57 or
58 /etc/group
59 is generated\&. If
60 "friendly", a more comprehensive and user friendly, human\-readable output is generated\&. If
61 "table", a minimal, tabular output is generated\&. If
62 "json", a JSON formatted output is generated\&. Defaults to
63 "friendly"
64 if a user/group is specified on the command line,
65 "table"
66 otherwise\&.
67 .sp
68 Note that most output formats do not show all available information\&. In particular,
69 "classic"
70 and
71 "table"
72 show only the most important fields\&. Various modes also do not show password hashes\&. Use
73 "json"
74 to view all fields, including any authentication fields\&.
75 .sp
76 Added in version 245\&.
77 .RE
78 .PP
79 \fB\-\-json=\fR\fB\fIFORMAT\fR\fR
80 .RS 4
81 Selects JSON output mode (like
82 \fB\-\-output=json\fR) and selects the precise display mode\&. Takes one of
83 "pretty"
84 or
85 "short"\&. If
86 "pretty", human\-friendly whitespace and newlines are inserted in the output to make the JSON data more readable\&. If
87 "short", all superfluous whitespace is suppressed\&.
88 .sp
89 Added in version 250\&.
90 .RE
91 .PP
92 \fB\-\-service=\fR\fB\fISERVICE\fR\fR\fB[:\fISERVICE\&...\fR]\fR, \fB\-s\fR \fISERVICE\fR:\fISERVICE\&...\fR
93 .RS 4
94 Controls which services to query for users/groups\&. Takes a list of one or more service names, separated by
95 ":"\&. See below for a list of well\-known service names\&. If not specified, all available services are queried at once\&.
96 .sp
97 Added in version 245\&.
98 .RE
99 .PP
100 \fB\-\-with\-nss=\fR\fB\fIBOOL\fR\fR
101 .RS 4
102 Controls whether to include classic glibc/NSS user/group lookups in the output\&. If
103 \fB\-\-with\-nss=no\fR
104 is used, any attempts to resolve or enumerate users/groups provided only via glibc NSS is suppressed\&. If
105 \fB\-\-with\-nss=yes\fR
106 is specified, such users/groups are included in the output (which is the default)\&.
107 .sp
108 Added in version 245\&.
109 .RE
110 .PP
111 \fB\-\-with\-varlink=\fR\fB\fIBOOL\fR\fR
112 .RS 4
113 Controls whether to include Varlink user/group lookups in the output, i\&.e\&. those done via the
114 \m[blue]\fBUser/Group Record Lookup API via Varlink\fR\m[]\&\s-2\u[3]\d\s+2\&. If
115 \fB\-\-with\-varlink=no\fR
116 is used, any attempts to resolve or enumerate users/groups provided only via Varlink are suppressed\&. If
117 \fB\-\-with\-varlink=yes\fR
118 is specified, such users/groups are included in the output (which is the default)\&.
119 .sp
120 Added in version 249\&.
121 .RE
122 .PP
123 \fB\-\-with\-dropin=\fR\fB\fIBOOL\fR\fR
124 .RS 4
125 Controls whether to include user/group lookups in the output that are defined using drop\-in files in
126 /etc/userdb/,
127 /run/userdb/,
128 /run/host/userdb/,
129 /usr/lib/userdb/\&. If
130 \fB\-\-with\-dropin=no\fR
131 is used, these records are suppressed\&. If
132 \fB\-\-with\-dropin=yes\fR
133 is specified, such users/groups are included in the output (which is the default)\&.
134 .sp
135 Added in version 249\&.
136 .RE
137 .PP
138 \fB\-\-synthesize=\fR\fB\fIBOOL\fR\fR
139 .RS 4
140 Controls whether to synthesize records for the root and nobody users/groups if they are not defined otherwise, as well as the user/groups for the "foreign" UID range\&. By default (or with
141 "yes"), such records are implicitly synthesized if otherwise missing since they have special significance to the OS\&. When
142 "no", this synthesizing is turned off\&.
143 .sp
144 Added in version 245\&.
145 .RE
146 .PP
147 \fB\-N\fR
148 .RS 4
149 This option is short for
150 \fB\-\-with\-nss=no\fR
151 \fB\-\-synthesize=no\fR\&. Use this option to show only records that are natively defined as JSON user or group records, with all NSS/glibc compatibility and all implicit synthesis turned off\&.
152 .sp
153 Added in version 245\&.
154 .RE
155 .PP
156 \fB\-\-multiplexer=\fR\fB\fIBOOL\fR\fR
157 .RS 4
158 Controls whether to do lookups via the multiplexer service (if specified as true, the default) or do lookups in the client (if specified as false)\&. Using the multiplexer service is typically preferable, since it runs in a locked down sandbox\&.
159 .sp
160 Added in version 250\&.
161 .RE
162 .PP
163 \fB\-\-chain\fR
164 .RS 4
165 When used with the
166 \fBssh\-authorized\-keys\fR
167 command, this will allow passing an additional command line after the user name that is chain executed after the lookup completed\&. This allows chaining multiple tools that show SSH authorized keys\&.
168 .sp
169 Added in version 250\&.
170 .RE
171 .PP
172 \fB\-\-fuzzy\fR, \fB\-z\fR
173 .RS 4
174 When used with the
175 \fBuser\fR
176 or
177 \fBgroup\fR
178 command, do a fuzzy string search\&. Any specified arguments will be matched against the user name, the real name of the user record, the email address, and other descriptive strings of the user or group record\&. Moreover, instead of precise matching, a substring match or a match allowing slight deviations in spelling is applied\&.
179 .sp
180 Added in version 257\&.
181 .RE
182 .PP
183 \fB\-\-disposition=\fR
184 .RS 4
185 When used with the
186 \fBuser\fR
187 or
188 \fBgroup\fR
189 command, filters by disposition of the record\&. Takes one of
190 "intrinsic",
191 "system",
192 "regular",
193 "dynamic",
194 "container"\&. May be used multiple times, in which case only users matching any of the specified dispositions are shown\&.
195 .sp
196 Added in version 257\&.
197 .RE
198 .PP
199 \fB\-I\fR, \fB\-S\fR, \fB\-R\fR
200 .RS 4
201 Shortcuts for
202 \fB\-\-disposition=intrinsic\fR,
203 \fB\-\-disposition=system\fR,
204 \fB\-\-disposition=regular\fR, respectively\&.
205 .sp
206 Added in version 257\&.
207 .RE
208 .PP
209 \fB\-\-uid\-min=\fR, \fB\-\-uid\-max=\fR
210 .RS 4
211 When used with the
212 \fBuser\fR
213 or
214 \fBgroup\fR
215 command, filters the output by UID/GID ranges\&. Takes numeric minimum or maximum UID/GID values, respectively\&. Shows only records within the specified range\&. When applied to the
216 \fBuser\fR
217 command, it matches against UIDs\&. When applied to the
218 \fBgroup\fR
219 command, matches against GIDs (despite the name of the switch)\&. If unspecified, defaults to 0 (for the minimum) and 4294967294 (for the maximum), i\&.e\&. by default, no filtering is applied, as the whole UID/GID range is covered\&.
220 .sp
221 Added in version 257\&.
222 .RE
223 .PP
224 \fB\-\-uuid=\fR
225 .RS 4
226 When used with the
227 \fBuser\fR
228 or
229 \fBgroup\fR
230 command, filters the output to the record with the specified UUID\&. If unspecified, no UUID\-based filtering is applied\&.
231 .sp
232 Added in version 259\&.
233 .RE
234 .PP
235 \fB\-\-boundaries=\fR
236 .RS 4
237 When used with the
238 \fBuser\fR
239 or
240 \fBgroup\fR
241 command, controls whether to show relevant UID/GID range boundary information in the tabular output\&. Takes a boolean\&. Defaults to true\&.
242 .sp
243 Added in version 257\&.
244 .RE
245 .PP
246 \fB\-B\fR
247 .RS 4
248 Shortcut for
249 \fB\-\-boundaries=no\fR\&.
250 .sp
251 Added in version 257\&.
252 .RE
253 .PP
254 \fB\-\-from\-file=PATH\fR, \fB\-F\fR
255 .RS 4
256 When used with the
257 \fBuser\fR
258 or
259 \fBgroup\fR
260 command, read the user definition in JSON format from the specified file, instead of querying it from the system\&. If the path is specified as
261 "\-", reads the JSON data from standard input\&. This is useful to validate and introspect JSON user or group records quickly, and check how they would be interpreted on the local system\&.
262 .sp
263 Added in version 258\&.
264 .RE
265 .PP
266 \fB\-\-no\-pager\fR
267 .RS 4
268 Do not pipe output into a pager\&.
269 .RE
270 .PP
271 \fB\-\-no\-legend\fR
272 .RS 4
273 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
274 .RE
275 .PP
276 \fB\-h\fR, \fB\-\-help\fR
277 .RS 4
278 Print a short help text and exit\&.
279 .RE
280 .PP
281 \fB\-\-version\fR
282 .RS 4
283 Print a short version string and exit\&.
284 .RE
285 .SH "COMMANDS"
286 .PP
287 The following commands are understood:
288 .PP
289 \fBuser\fR [\fIUSER\fR\&...]
290 .RS 4
291 List all known users records or show details of one or more specified user records\&. Use
292 \fB\-\-output=\fR
293 to tweak output mode\&.
294 .sp
295 If used in conjunction with
296 \fB\-\-from\-file=\fR
297 the user record data is read in JSON format from the specified file instead of querying it from the system\&. For details see above\&.
298 .sp
299 Added in version 245\&.
300 .RE
301 .PP
302 \fBgroup\fR [\fIGROUP\fR\&...]
303 .RS 4
304 List all known group records or show details of one or more specified group records\&. Use
305 \fB\-\-output=\fR
306 to tweak the output mode\&.
307 .sp
308 If used in conjunction with
309 \fB\-\-from\-file=\fR
310 the group record data is read in JSON format from the specified file instead of querying it from the system\&. For details see above\&.
311 .sp
312 Added in version 245\&.
313 .RE
314 .PP
315 \fBusers\-in\-group\fR [\fIGROUP\fR\&...]
316 .RS 4
317 List users that are members of the specified groups\&. If no groups are specified, list all user/group memberships defined\&. Use
318 \fB\-\-output=\fR
319 to tweak the output mode\&.
320 .sp
321 Added in version 245\&.
322 .RE
323 .PP
324 \fBgroups\-of\-user\fR [\fIUSER\fR\&...]
325 .RS 4
326 Lists groups that the specified users are members of\&. If no users are specified, lists all user/group memberships defined (in this case,
327 \fBgroups\-of\-user\fR
328 and
329 \fBusers\-in\-group\fR
330 are equivalent)\&. Use
331 \fB\-\-output=\fR
332 to tweak the output mode\&.
333 .sp
334 Added in version 245\&.
335 .RE
336 .PP
337 \fBservices\fR
338 .RS 4
339 List all services currently providing user/group definitions to the system\&. See below for a list of well\-known services providing user information\&.
340 .sp
341 Added in version 245\&.
342 .RE
343 .PP
344 \fBssh\-authorized\-keys\fR
345 .RS 4
346 Show SSH authorized keys for this account\&. This command is intended to be used to allow the SSH daemon to pick up authorized keys from user records, see below\&.
347 .sp
348 Added in version 245\&.
349 .RE
350 .PP
351 \fBload\-credentials\fR
352 .RS 4
353 When specified, the following credentials are used when passed in:
354 .PP
355 \fIuserdb\&.user\&.*\fR, \fIuserdb\&.group\&.*\fR
356 .RS 4
357 These credentials should contain valid
358 \m[blue]\fBJSON User\fR\m[]\&\s-2\u[1]\d\s+2
359 and
360 \m[blue]\fBJSON Group\fR\m[]\&\s-2\u[2]\d\s+2
361 records\&. For each matching credential, various files are created in
362 /etc/userdb/, implementing the interface described in
363 \fBnss-systemd\fR(8)\&. Any passed user records must contain valid UID and GID fields\&. Any passed group records must contain a GID field (i\&.e\&. automatic UID/GID allocation is not supported)\&. For both user and group records, the credential suffix (for
364 "userdb\&.user\&.foobar"
365 the suffix is
366 "foobar") must match the user or group name encoded in the record\&.
367 .sp
368 Added in version 258\&.
369 .RE
370 .sp
371 Added in version 258\&.
372 .RE
373 .SH "WELL\-KNOWN SERVICES"
374 .PP
375 The
376 \fBuserdbctl services\fR
377 command will list all currently running services that provide user or group definitions to the system\&. The following well\-known services are shown among this list:
378 .PP
379 \fBio\&.systemd\&.DynamicUser\fR
380 .RS 4
381 This service is provided by the system service manager itself (i\&.e\&. PID 1) and makes all users (and their groups) synthesized through the
382 \fIDynamicUser=\fR
383 setting in service unit files available to the system (see
384 \fBsystemd.exec\fR(5)
385 for details about this setting)\&.
386 .sp
387 Added in version 245\&.
388 .RE
389 .PP
390 \fBio\&.systemd\&.Home\fR
391 .RS 4
392 This service is provided by
393 \fBsystemd-homed.service\fR(8)
394 and makes all users (and their groups) belonging to home directories managed by that service available to the system\&.
395 .sp
396 Added in version 245\&.
397 .RE
398 .PP
399 \fBio\&.systemd\&.Machine\fR
400 .RS 4
401 This service is provided by
402 \fBsystemd-machined.service\fR(8)
403 and synthesizes records for all users/groups used by a container that employs user namespacing\&.
404 .sp
405 Added in version 246\&.
406 .RE
407 .PP
408 \fBio\&.systemd\&.Multiplexer\fR
409 .RS 4
410 This service is provided by
411 \fBsystemd-userdbd.service\fR(8)
412 and multiplexes user/group look\-ups to all other running lookup services\&. This is the primary entry point for user/group record clients, as it simplifies client side implementation substantially, since they can ask a single service for lookups instead of asking all running services in parallel\&.
413 \fBuserdbctl\fR
414 uses this service preferably, too, unless
415 \fB\-\-with\-nss=\fR
416 or
417 \fB\-\-service=\fR
418 are used, in which case finer control over the services to talk to is required\&.
419 .sp
420 Added in version 245\&.
421 .RE
422 .PP
423 \fBio\&.systemd\&.NameServiceSwitch\fR
424 .RS 4
425 This service is (also) provided by
426 \fBsystemd-userdbd.service\fR(8)
427 and converts classic NSS/glibc user and group records to JSON user/group records, providing full backwards compatibility\&. Use
428 \fB\-\-with\-nss=no\fR
429 to disable this compatibility, see above\&. Note that compatibility is actually provided in both directions:
430 \fBnss-systemd\fR(8)
431 will automatically synthesize classic NSS/glibc user/group records from all JSON user/group records provided to the system, thus using both APIs is mostly equivalent and provides access to the same data, however the NSS/glibc APIs necessarily expose a more reduced set of fields only\&.
432 .sp
433 Added in version 245\&.
434 .RE
435 .PP
436 \fBio\&.systemd\&.DropIn\fR
437 .RS 4
438 This service is (also) provided by
439 \fBsystemd-userdbd.service\fR(8)
440 and picks up JSON user/group records from
441 /etc/userdb/,
442 /run/userdb/,
443 /run/host/userdb/,
444 /usr/lib/userdb/\&.
445 .sp
446 Added in version 249\&.
447 .RE
448 .PP
449 Note that
450 \fBuserdbctl\fR
451 has internal support for NSS\-based lookups too\&. This means that if neither
452 \fBio\&.systemd\&.Multiplexer\fR
453 nor
454 \fBio\&.systemd\&.NameServiceSwitch\fR
455 are running, look\-ups into the basic user/group databases will still work\&.
456 .SH "INTEGRATION WITH SSH"
457 .PP
458 The
459 \fBuserdbctl\fR
460 tool may be used to make the list of SSH authorized keys possibly contained in a user record available to the SSH daemon for authentication\&. For that, configure the following in
461 \fBsshd_config\fR(5):
462 .sp
463 .if n \{\
464 .RS 4
465 .\}
466 .nf
467 \&...
468 AuthorizedKeysCommand /usr/bin/userdbctl ssh\-authorized\-keys %u
469 AuthorizedKeysCommandUser root
470 \&...
471 .fi
472 .if n \{\
473 .RE
474 .\}
475 .PP
476 Sometimes, it is useful to allow chain invocation of another program to list SSH authorized keys\&. By using the
477 \fB\-\-chain\fR
478 option, such a tool may be chain executed by
479 \fBuserdbctl ssh\-authorized\-keys\fR
480 once a lookup completes, regardless of whether an SSH key was found or not\&. Example:
481 .sp
482 .if n \{\
483 .RS 4
484 .\}
485 .nf
486 \&...
487 AuthorizedKeysCommand /usr/bin/userdbctl ssh\-authorized\-keys %u \-\-chain /usr/bin/othertool %u
488 AuthorizedKeysCommandUser root
489 \&...
490 .fi
491 .if n \{\
492 .RE
493 .\}
494 .PP
495 The above will first query the userdb database for SSH keys, and then chain execute
496 \fB/usr/bin/othertool\fR
497 to also be queried\&.
498 .SH "EXIT STATUS"
499 .PP
500 On success, 0 is returned, and a non\-zero failure code otherwise\&.
501 .SH "ENVIRONMENT"
502 .PP
503 \fI$SYSTEMD_LOG_LEVEL\fR
504 .RS 4
505 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)
506 \fBemerg\fR,
507 \fBalert\fR,
508 \fBcrit\fR,
509 \fBerr\fR,
510 \fBwarning\fR,
511 \fBnotice\fR,
512 \fBinfo\fR,
513 \fBdebug\fR, or an integer in the range 0\&...7\&. See
514 \fBsyslog\fR(3)
515 for more information\&. Each value may optionally be prefixed with one of
516 \fBconsole\fR,
517 \fBsyslog\fR,
518 \fBkmsg\fR
519 or
520 \fBjournal\fR
521 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
522 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
523 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\&.
524 .RE
525 .PP
526 \fI$SYSTEMD_LOG_COLOR\fR
527 .RS 4
528 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
529 .sp
530 This setting is only useful when messages are written directly to the terminal, because
531 \fBjournalctl\fR(1)
532 and other tools that display logs will color messages based on the log level on their own\&.
533 .RE
534 .PP
535 \fI$SYSTEMD_LOG_TIME\fR
536 .RS 4
537 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
538 .sp
539 This setting is only useful when messages are written directly to the terminal or a file, because
540 \fBjournalctl\fR(1)
541 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
542 .RE
543 .PP
544 \fI$SYSTEMD_LOG_LOCATION\fR
545 .RS 4
546 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
547 .sp
548 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\&.
549 .RE
550 .PP
551 \fI$SYSTEMD_LOG_TID\fR
552 .RS 4
553 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
554 .sp
555 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\&.
556 .RE
557 .PP
558 \fI$SYSTEMD_LOG_TARGET\fR
559 .RS 4
560 The destination for log messages\&. One of
561 \fBconsole\fR
562 (log to the attached tty),
563 \fBconsole\-prefixed\fR
564 (log to the attached tty but with prefixes encoding the log level and "facility", see
565 \fBsyslog\fR(3),
566 \fBkmsg\fR
567 (log to the kernel circular log buffer),
568 \fBjournal\fR
569 (log to the journal),
570 \fBjournal\-or\-kmsg\fR
571 (log to the journal if available, and to kmsg otherwise),
572 \fBauto\fR
573 (determine the appropriate log target automatically, the default),
574 \fBnull\fR
575 (disable log output)\&.
576 .RE
577 .PP
578 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
579 .RS 4
580 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
581 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
582 .RE
583 .PP
584 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
585 .RS 4
586 Pager to use when
587 \fB\-\-no\-pager\fR
588 is not given\&.
589 \fI$SYSTEMD_PAGER\fR
590 is used if set; otherwise
591 \fI$PAGER\fR
592 is used\&. If neither
593 \fI$SYSTEMD_PAGER\fR
594 nor
595 \fI$PAGER\fR
596 are set, a set of well\-known pager implementations is tried in turn, including
597 \fBless\fR(1)
598 and
599 \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
600 "cat"
601 is equivalent to passing
602 \fB\-\-no\-pager\fR\&.
603 .sp
604 Note: if
605 \fI$SYSTEMD_PAGERSECURE\fR
606 is not set,
607 \fI$SYSTEMD_PAGER\fR
608 and
609 \fI$PAGER\fR
610 can only be used to disable the pager (with
611 "cat"
612 or
613 ""), and are otherwise ignored\&.
614 .RE
615 .PP
616 \fI$SYSTEMD_LESS\fR
617 .RS 4
618 Override the options passed to
619 \fBless\fR
620 (by default
621 "FRSXMK")\&.
622 .sp
623 Users might want to change two options in particular:
624 .PP
625 \fBK\fR
626 .RS 4
627 This option instructs the pager to exit immediately when
628 Ctrl+C
629 is pressed\&. To allow
630 \fBless\fR
631 to handle
632 Ctrl+C
633 itself to switch back to the pager command prompt, unset this option\&.
634 .sp
635 If the value of
636 \fI$SYSTEMD_LESS\fR
637 does not include
638 "K", and the pager that is invoked is
639 \fBless\fR,
640 Ctrl+C
641 will be ignored by the executable, and needs to be handled by the pager\&.
642 .RE
643 .PP
644 \fBX\fR
645 .RS 4
646 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\&.
647 .RE
648 .sp
649 Note that setting the regular
650 \fI$LESS\fR
651 environment variable has no effect for
652 \fBless\fR
653 invocations by systemd tools\&.
654 .sp
655 See
656 \fBless\fR(1)
657 for more discussion\&.
658 .RE
659 .PP
660 \fI$SYSTEMD_LESSCHARSET\fR
661 .RS 4
662 Override the charset passed to
663 \fBless\fR
664 (by default
665 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
666 .sp
667 Note that setting the regular
668 \fI$LESSCHARSET\fR
669 environment variable has no effect for
670 \fBless\fR
671 invocations by systemd tools\&.
672 .RE
673 .PP
674 \fI$SYSTEMD_PAGERSECURE\fR
675 .RS 4
676 Common pager commands like
677 \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
678 \fBsudo\fR(8)
679 or
680 \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,
681 \fIif the pager supports that\fR
682 (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
683 \fB\-\-no\-pager\fR
684 or
685 \fIPAGER=cat\fR
686 when allowing untrusted users to execute commands with elevated privileges\&.
687 .sp
688 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
689 \fBLESSSECURE=1\fR
690 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
691 \fBless\fR(1)
692 is known to understand this variable and implement "secure mode"\&.
693 .sp
694 When set to false, no limitation is placed on the pager\&. Setting
695 \fISYSTEMD_PAGERSECURE=0\fR
696 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
697 .sp
698 When
699 \fI$SYSTEMD_PAGERSECURE\fR
700 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
701 \fBgeteuid\fR(2)
702 and
703 \fBsd_pid_get_owner_uid\fR(3), or when running under
704 \fBsudo\fR(8)
705 or similar tools (\fI$SUDO_UID\fR
706 is set
707 \&\s-2\u[4]\d\s+2)\&. In those cases,
708 \fISYSTEMD_PAGERSECURE=1\fR
709 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
710 \fI$SYSTEMD_PAGERSECURE\fR
711 or disable the pager\&.
712 .sp
713 Note that if the
714 \fI$SYSTEMD_PAGER\fR
715 or
716 \fI$PAGER\fR
717 variables are to be honoured, other than to disable the pager,
718 \fI$SYSTEMD_PAGERSECURE\fR
719 must be set too\&.
720 .RE
721 .PP
722 \fI$SYSTEMD_COLORS\fR
723 .RS 4
724 Takes a boolean argument, or a special value\&. By default (unset),
725 \fBsystemd\fR
726 and related utilities will use colors in their output if possible\&. If
727 \fI$COLORTERM\fR
728 is set to
729 "truecolor"
730 or
731 "24bit", 24\-bit colors will be enabled, 256 colors otherwise, unless
732 \fI$NO_COLOR\fR
733 or
734 \fI$TERM\fR
735 indicates colors are disabled\&.
736 .PP
737 \fBtrue\fR
738 .RS 4
739 Same as unset, except that
740 \fI$NO_COLOR\fR
741 is ignored\&.
742 .RE
743 .PP
744 \fBfalse\fR
745 .RS 4
746 The output will be monochrome\&.
747 .RE
748 .PP
749 "16", "256", "24bit"
750 .RS 4
751 Always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively\&.
752 .RE
753 .PP
754 "auto\-16", "auto\-256", "auto\-24bit"
755 .RS 4
756 Use the given quantity of colours, subject to
757 \fI$TERM\fR, and what the console is connected to\&.
758 .RE
759 .RE
760 .PP
761 \fI$SYSTEMD_URLIFY\fR
762 .RS 4
763 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
764 \fBsystemd\fR
765 makes based on
766 \fI$TERM\fR
767 and other conditions\&.
768 .RE
769 .SH "SEE ALSO"
770 .PP
771 \fBsystemd\fR(1), \fBsystemd-userdbd.service\fR(8), \fBsystemd-homed.service\fR(8), \fBnss-systemd\fR(8), \fBgetent\fR(1)
772 .SH "NOTES"
773 .IP " 1." 4
774 JSON User Records
775 .RS 4
776 \%https://systemd.io/USER_RECORD
777 .RE
778 .IP " 2." 4
779 JSON Group Records
780 .RS 4
781 \%https://systemd.io/GROUP_RECORD
782 .RE
783 .IP " 3." 4
784 User/Group Record Lookup API via Varlink
785 .RS 4
786 \%https://systemd.io/USER_GROUP_API
787 .RE
788 .IP " 4." 4
789 It is recommended for other tools to set and check
790 \fI$SUDO_UID\fR
791 as appropriate, treating it is a common interface.
792