Debian Codegraph @

upstream/debian-trixie/man1/userdbctl.1

raw
1 '\" t
2 .TH "USERDBCTL" "1" "" "systemd 257.13" "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 .SH "OPTIONS"
41 .PP
42 The following options are understood:
43 .PP
44 \fB\-\-output=\fR\fB\fIMODE\fR\fR
45 .RS 4
46 Choose the output mode, takes one of
47 "classic",
48 "friendly",
49 "table",
50 "json"\&. If
51 "classic", an output very close to the format of
52 /etc/passwd
53 or
54 /etc/group
55 is generated\&. If
56 "friendly"
57 a more comprehensive and user friendly, human readable output is generated; if
58 "table"
59 a minimal, tabular output is generated; if
60 "json"
61 a JSON formatted output is generated\&. Defaults to
62 "friendly"
63 if a user/group is specified on the command line,
64 "table"
65 otherwise\&.
66 .sp
67 Note that most output formats do not show all available information\&. In particular,
68 "classic"
69 and
70 "table"
71 show only the most important fields\&. Various modes also do not show password hashes\&. Use
72 "json"
73 to view all fields, including any authentication fields\&.
74 .sp
75 Added in version 245\&.
76 .RE
77 .PP
78 \fB\-\-json=\fR\fB\fIFORMAT\fR\fR
79 .RS 4
80 Selects JSON output mode (like
81 \fB\-\-output=json\fR) and selects the precise display mode\&. Takes one of
82 "pretty"
83 or
84 "short"\&. If
85 "pretty", human\-friendly whitespace and newlines are inserted in the output to make the JSON data more readable\&. If
86 "short", all superfluous whitespace is suppressed\&.
87 .sp
88 Added in version 250\&.
89 .RE
90 .PP
91 \fB\-\-service=\fR\fB\fISERVICE\fR\fR\fB[:\fISERVICE\&...\fR]\fR, \fB\-s\fR \fISERVICE\fR:\fISERVICE\&...\fR
92 .RS 4
93 Controls which services to query for users/groups\&. Takes a list of one or more service names, separated by
94 ":"\&. See below for a list of well\-known service names\&. If not specified, all available services are queried at once\&.
95 .sp
96 Added in version 245\&.
97 .RE
98 .PP
99 \fB\-\-with\-nss=\fR\fB\fIBOOL\fR\fR
100 .RS 4
101 Controls whether to include classic glibc/NSS user/group lookups in the output\&. If
102 \fB\-\-with\-nss=no\fR
103 is used any attempts to resolve or enumerate users/groups provided only via glibc NSS is suppressed\&. If
104 \fB\-\-with\-nss=yes\fR
105 is specified such users/groups are included in the output (which is the default)\&.
106 .sp
107 Added in version 245\&.
108 .RE
109 .PP
110 \fB\-\-with\-varlink=\fR\fB\fIBOOL\fR\fR
111 .RS 4
112 Controls whether to include Varlink user/group lookups in the output, i\&.e\&. those done via the
113 \m[blue]\fBUser/Group Record Lookup API via Varlink\fR\m[]\&\s-2\u[3]\d\s+2\&. If
114 \fB\-\-with\-varlink=no\fR
115 is used any attempts to resolve or enumerate users/groups provided only via Varlink are suppressed\&. If
116 \fB\-\-with\-varlink=yes\fR
117 is specified such users/groups are included in the output (which is the default)\&.
118 .sp
119 Added in version 249\&.
120 .RE
121 .PP
122 \fB\-\-with\-dropin=\fR\fB\fIBOOL\fR\fR
123 .RS 4
124 Controls whether to include user/group lookups in the output that are defined using drop\-in files in
125 /etc/userdb/,
126 /run/userdb/,
127 /run/host/userdb/,
128 /usr/lib/userdb/\&. If
129 \fB\-\-with\-dropin=no\fR
130 is used these records are suppressed\&. If
131 \fB\-\-with\-dropin=yes\fR
132 is specified such users/groups are included in the output (which is the default)\&.
133 .sp
134 Added in version 249\&.
135 .RE
136 .PP
137 \fB\-\-synthesize=\fR\fB\fIBOOL\fR\fR
138 .RS 4
139 Controls whether to synthesize records for the root and nobody users/groups if they are not defined otherwise\&. By default (or
140 "yes"), such records are implicitly synthesized if otherwise missing since they have special significance to the OS\&. When
141 "no"
142 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 resp\&. maximum UID/GID values\&. Shows only records within the specified range\&. When applied to the
216 \fBuser\fR
217 command matches against UIDs, when applied to the
218 \fBgroup\fR
219 command 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\-\-boundaries=\fR
225 .RS 4
226 When used with the
227 \fBuser\fR
228 or
229 \fBgroup\fR
230 command, controls whether to show relevant UID/GID range boundary information in the tabular output\&. Takes a boolean\&. Defaults to true\&.
231 .sp
232 Added in version 257\&.
233 .RE
234 .PP
235 \fB\-B\fR
236 .RS 4
237 Shortcut for
238 \fB\-\-boundaries=no\fR\&.
239 .sp
240 Added in version 257\&.
241 .RE
242 .PP
243 \fB\-\-no\-pager\fR
244 .RS 4
245 Do not pipe output into a pager\&.
246 .RE
247 .PP
248 \fB\-\-no\-legend\fR
249 .RS 4
250 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
251 .RE
252 .PP
253 \fB\-h\fR, \fB\-\-help\fR
254 .RS 4
255 Print a short help text and exit\&.
256 .RE
257 .PP
258 \fB\-\-version\fR
259 .RS 4
260 Print a short version string and exit\&.
261 .RE
262 .SH "COMMANDS"
263 .PP
264 The following commands are understood:
265 .PP
266 \fBuser\fR [\fIUSER\fR\&...]
267 .RS 4
268 List all known users records or show details of one or more specified user records\&. Use
269 \fB\-\-output=\fR
270 to tweak output mode\&.
271 .sp
272 Added in version 245\&.
273 .RE
274 .PP
275 \fBgroup\fR [\fIGROUP\fR\&...]
276 .RS 4
277 List all known group records or show details of one or more specified group records\&. Use
278 \fB\-\-output=\fR
279 to tweak output mode\&.
280 .sp
281 Added in version 245\&.
282 .RE
283 .PP
284 \fBusers\-in\-group\fR [\fIGROUP\fR\&...]
285 .RS 4
286 List users that are members of the specified groups\&. If no groups are specified list all user/group memberships defined\&. Use
287 \fB\-\-output=\fR
288 to tweak output mode\&.
289 .sp
290 Added in version 245\&.
291 .RE
292 .PP
293 \fBgroups\-of\-user\fR [\fIUSER\fR\&...]
294 .RS 4
295 List groups that the specified users are members of\&. If no users are specified list all user/group memberships defined (in this case,
296 \fBgroups\-of\-user\fR
297 and
298 \fBusers\-in\-group\fR
299 are equivalent)\&. Use
300 \fB\-\-output=\fR
301 to tweak output mode\&.
302 .sp
303 Added in version 245\&.
304 .RE
305 .PP
306 \fBservices\fR
307 .RS 4
308 List all services currently providing user/group definitions to the system\&. See below for a list of well\-known services providing user information\&.
309 .sp
310 Added in version 245\&.
311 .RE
312 .PP
313 \fBssh\-authorized\-keys\fR
314 .RS 4
315 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\&.
316 .sp
317 Added in version 245\&.
318 .RE
319 .SH "WELL\-KNOWN SERVICES"
320 .PP
321 The
322 \fBuserdbctl services\fR
323 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:
324 .PP
325 \fBio\&.systemd\&.DynamicUser\fR
326 .RS 4
327 This service is provided by the system service manager itself (i\&.e\&. PID 1) and makes all users (and their groups) synthesized through the
328 \fIDynamicUser=\fR
329 setting in service unit files available to the system (see
330 \fBsystemd.exec\fR(5)
331 for details about this setting)\&.
332 .sp
333 Added in version 245\&.
334 .RE
335 .PP
336 \fBio\&.systemd\&.Home\fR
337 .RS 4
338 This service is provided by
339 \fBsystemd-homed.service\fR(8)
340 and makes all users (and their groups) belonging to home directories managed by that service available to the system\&.
341 .sp
342 Added in version 245\&.
343 .RE
344 .PP
345 \fBio\&.systemd\&.Machine\fR
346 .RS 4
347 This service is provided by
348 \fBsystemd-machined.service\fR(8)
349 and synthesizes records for all users/groups used by a container that employs user namespacing\&.
350 .sp
351 Added in version 246\&.
352 .RE
353 .PP
354 \fBio\&.systemd\&.Multiplexer\fR
355 .RS 4
356 This service is provided by
357 \fBsystemd-userdbd.service\fR(8)
358 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\&.
359 \fBuserdbctl\fR
360 uses this service preferably, too, unless
361 \fB\-\-with\-nss=\fR
362 or
363 \fB\-\-service=\fR
364 are used, in which case finer control over the services to talk to is required\&.
365 .sp
366 Added in version 245\&.
367 .RE
368 .PP
369 \fBio\&.systemd\&.NameServiceSwitch\fR
370 .RS 4
371 This service is (also) provided by
372 \fBsystemd-userdbd.service\fR(8)
373 and converts classic NSS/glibc user and group records to JSON user/group records, providing full backwards compatibility\&. Use
374 \fB\-\-with\-nss=no\fR
375 to disable this compatibility, see above\&. Note that compatibility is actually provided in both directions:
376 \fBnss-systemd\fR(8)
377 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\&.
378 .sp
379 Added in version 245\&.
380 .RE
381 .PP
382 \fBio\&.systemd\&.DropIn\fR
383 .RS 4
384 This service is (also) provided by
385 \fBsystemd-userdbd.service\fR(8)
386 and picks up JSON user/group records from
387 /etc/userdb/,
388 /run/userdb/,
389 /run/host/userdb/,
390 /usr/lib/userdb/\&.
391 .sp
392 Added in version 249\&.
393 .RE
394 .PP
395 Note that
396 \fBuserdbctl\fR
397 has internal support for NSS\-based lookups too\&. This means that if neither
398 \fBio\&.systemd\&.Multiplexer\fR
399 nor
400 \fBio\&.systemd\&.NameServiceSwitch\fR
401 are running look\-ups into the basic user/group databases will still work\&.
402 .SH "INTEGRATION WITH SSH"
403 .PP
404 The
405 \fBuserdbctl\fR
406 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
407 \fBsshd_config\fR(5):
408 .sp
409 .if n \{\
410 .RS 4
411 .\}
412 .nf
413 \&...
414 AuthorizedKeysCommand /usr/bin/userdbctl ssh\-authorized\-keys %u
415 AuthorizedKeysCommandUser root
416 \&...
417 .fi
418 .if n \{\
419 .RE
420 .\}
421 .PP
422 Sometimes it is useful to allow chain invocation of another program to list SSH authorized keys\&. By using the
423 \fB\-\-chain\fR
424 such a tool may be chain executed by
425 \fBuserdbctl ssh\-authorized\-keys\fR
426 once a lookup completes (regardless if an SSH key was found or not)\&. Example:
427 .sp
428 .if n \{\
429 .RS 4
430 .\}
431 .nf
432 \&...
433 AuthorizedKeysCommand /usr/bin/userdbctl ssh\-authorized\-keys %u \-\-chain /usr/bin/othertool %u
434 AuthorizedKeysCommandUser root
435 \&...
436 .fi
437 .if n \{\
438 .RE
439 .\}
440 .PP
441 The above will first query the userdb database for SSH keys, and then chain execute
442 \fB/usr/bin/othertool\fR
443 to also be queried\&.
444 .SH "EXIT STATUS"
445 .PP
446 On success, 0 is returned, a non\-zero failure code otherwise\&.
447 .SH "ENVIRONMENT"
448 .PP
449 \fI$SYSTEMD_LOG_LEVEL\fR
450 .RS 4
451 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)
452 \fBemerg\fR,
453 \fBalert\fR,
454 \fBcrit\fR,
455 \fBerr\fR,
456 \fBwarning\fR,
457 \fBnotice\fR,
458 \fBinfo\fR,
459 \fBdebug\fR, or an integer in the range 0\&...7\&. See
460 \fBsyslog\fR(3)
461 for more information\&. Each value may optionally be prefixed with one of
462 \fBconsole\fR,
463 \fBsyslog\fR,
464 \fBkmsg\fR
465 or
466 \fBjournal\fR
467 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
468 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
469 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\&.
470 .RE
471 .PP
472 \fI$SYSTEMD_LOG_COLOR\fR
473 .RS 4
474 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
475 .sp
476 This setting is only useful when messages are written directly to the terminal, because
477 \fBjournalctl\fR(1)
478 and other tools that display logs will color messages based on the log level on their own\&.
479 .RE
480 .PP
481 \fI$SYSTEMD_LOG_TIME\fR
482 .RS 4
483 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
484 .sp
485 This setting is only useful when messages are written directly to the terminal or a file, because
486 \fBjournalctl\fR(1)
487 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
488 .RE
489 .PP
490 \fI$SYSTEMD_LOG_LOCATION\fR
491 .RS 4
492 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
493 .sp
494 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\&.
495 .RE
496 .PP
497 \fI$SYSTEMD_LOG_TID\fR
498 .RS 4
499 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
500 .sp
501 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\&.
502 .RE
503 .PP
504 \fI$SYSTEMD_LOG_TARGET\fR
505 .RS 4
506 The destination for log messages\&. One of
507 \fBconsole\fR
508 (log to the attached tty),
509 \fBconsole\-prefixed\fR
510 (log to the attached tty but with prefixes encoding the log level and "facility", see
511 \fBsyslog\fR(3),
512 \fBkmsg\fR
513 (log to the kernel circular log buffer),
514 \fBjournal\fR
515 (log to the journal),
516 \fBjournal\-or\-kmsg\fR
517 (log to the journal if available, and to kmsg otherwise),
518 \fBauto\fR
519 (determine the appropriate log target automatically, the default),
520 \fBnull\fR
521 (disable log output)\&.
522 .RE
523 .PP
524 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
525 .RS 4
526 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
527 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
528 .RE
529 .PP
530 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
531 .RS 4
532 Pager to use when
533 \fB\-\-no\-pager\fR
534 is not given\&.
535 \fI$SYSTEMD_PAGER\fR
536 is used if set; otherwise
537 \fI$PAGER\fR
538 is used\&. If neither
539 \fI$SYSTEMD_PAGER\fR
540 nor
541 \fI$PAGER\fR
542 are set, a set of well\-known pager implementations is tried in turn, including
543 \fBless\fR(1)
544 and
545 \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
546 "cat"
547 is equivalent to passing
548 \fB\-\-no\-pager\fR\&.
549 .sp
550 Note: if
551 \fI$SYSTEMD_PAGERSECURE\fR
552 is not set,
553 \fI$SYSTEMD_PAGER\fR
554 and
555 \fI$PAGER\fR
556 can only be used to disable the pager (with
557 "cat"
558 or
559 ""), and are otherwise ignored\&.
560 .RE
561 .PP
562 \fI$SYSTEMD_LESS\fR
563 .RS 4
564 Override the options passed to
565 \fBless\fR
566 (by default
567 "FRSXMK")\&.
568 .sp
569 Users might want to change two options in particular:
570 .PP
571 \fBK\fR
572 .RS 4
573 This option instructs the pager to exit immediately when
574 Ctrl+C
575 is pressed\&. To allow
576 \fBless\fR
577 to handle
578 Ctrl+C
579 itself to switch back to the pager command prompt, unset this option\&.
580 .sp
581 If the value of
582 \fI$SYSTEMD_LESS\fR
583 does not include
584 "K", and the pager that is invoked is
585 \fBless\fR,
586 Ctrl+C
587 will be ignored by the executable, and needs to be handled by the pager\&.
588 .RE
589 .PP
590 \fBX\fR
591 .RS 4
592 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\&.
593 .RE
594 .sp
595 Note that setting the regular
596 \fI$LESS\fR
597 environment variable has no effect for
598 \fBless\fR
599 invocations by systemd tools\&.
600 .sp
601 See
602 \fBless\fR(1)
603 for more discussion\&.
604 .RE
605 .PP
606 \fI$SYSTEMD_LESSCHARSET\fR
607 .RS 4
608 Override the charset passed to
609 \fBless\fR
610 (by default
611 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
612 .sp
613 Note that setting the regular
614 \fI$LESSCHARSET\fR
615 environment variable has no effect for
616 \fBless\fR
617 invocations by systemd tools\&.
618 .RE
619 .PP
620 \fI$SYSTEMD_PAGERSECURE\fR
621 .RS 4
622 Common pager commands like
623 \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
624 \fBsudo\fR(8)
625 or
626 \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,
627 \fIif the pager supports that\fR
628 (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
629 \fB\-\-no\-pager\fR
630 or
631 \fIPAGER=cat\fR
632 when allowing untrusted users to execute commands with elevated privileges\&.
633 .sp
634 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
635 \fBLESSSECURE=1\fR
636 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
637 \fBless\fR(1)
638 is known to understand this variable and implement "secure mode"\&.
639 .sp
640 When set to false, no limitation is placed on the pager\&. Setting
641 \fISYSTEMD_PAGERSECURE=0\fR
642 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
643 .sp
644 When
645 \fI$SYSTEMD_PAGERSECURE\fR
646 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
647 \fBgeteuid\fR(2)
648 and
649 \fBsd_pid_get_owner_uid\fR(3), or when running under
650 \fBsudo\fR(8)
651 or similar tools (\fI$SUDO_UID\fR
652 is set
653 \&\s-2\u[4]\d\s+2)\&. In those cases,
654 \fISYSTEMD_PAGERSECURE=1\fR
655 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
656 \fI$SYSTEMD_PAGERSECURE\fR
657 or disable the pager\&.
658 .sp
659 Note that if the
660 \fI$SYSTEMD_PAGER\fR
661 or
662 \fI$PAGER\fR
663 variables are to be honoured, other than to disable the pager,
664 \fI$SYSTEMD_PAGERSECURE\fR
665 must be set too\&.
666 .RE
667 .PP
668 \fI$SYSTEMD_COLORS\fR
669 .RS 4
670 Takes a boolean argument\&. When true,
671 \fBsystemd\fR
672 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:
673 "16",
674 "256"
675 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
676 \fI$TERM\fR
677 and what the console is connected to\&.
678 .RE
679 .PP
680 \fI$SYSTEMD_URLIFY\fR
681 .RS 4
682 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
683 \fBsystemd\fR
684 makes based on
685 \fI$TERM\fR
686 and other conditions\&.
687 .RE
688 .SH "SEE ALSO"
689 .PP
690 \fBsystemd\fR(1), \fBsystemd-userdbd.service\fR(8), \fBsystemd-homed.service\fR(8), \fBnss-systemd\fR(8), \fBgetent\fR(1)
691 .SH "NOTES"
692 .IP " 1." 4
693 JSON User Records
694 .RS 4
695 \%https://systemd.io/USER_RECORD
696 .RE
697 .IP " 2." 4
698 JSON Group Records
699 .RS 4
700 \%https://systemd.io/GROUP_RECORD
701 .RE
702 .IP " 3." 4
703 User/Group Record Lookup API via Varlink
704 .RS 4
705 \%https://systemd.io/USER_GROUP_API
706 .RE
707 .IP " 4." 4
708 It is recommended for other tools to set and check
709 \fI$SUDO_UID\fR
710 as appropriate, treating it is a common interface.
711