Debian Codegraph @

upstream/mageia-cauldron/man1/userdbctl.1

raw
1 '\" t
2 .TH "USERDBCTL" "1" "" "systemd 258.7" "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\-\-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\-\-from\-file=PATH\fR, \fB\-F\fR
244 .RS 4
245 When used with the
246 \fBuser\fR
247 or
248 \fBgroup\fR
249 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
250 "\-", 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\&.
251 .sp
252 Added in version 258\&.
253 .RE
254 .PP
255 \fB\-\-no\-pager\fR
256 .RS 4
257 Do not pipe output into a pager\&.
258 .RE
259 .PP
260 \fB\-\-no\-legend\fR
261 .RS 4
262 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
263 .RE
264 .PP
265 \fB\-h\fR, \fB\-\-help\fR
266 .RS 4
267 Print a short help text and exit\&.
268 .RE
269 .PP
270 \fB\-\-version\fR
271 .RS 4
272 Print a short version string and exit\&.
273 .RE
274 .SH "COMMANDS"
275 .PP
276 The following commands are understood:
277 .PP
278 \fBuser\fR [\fIUSER\fR\&...]
279 .RS 4
280 List all known users records or show details of one or more specified user records\&. Use
281 \fB\-\-output=\fR
282 to tweak output mode\&.
283 .sp
284 If used in conjunction with
285 \fB\-\-from\-file=\fR
286 the user record data is read in JSON format from the specified file instead of querying it from the system\&. For details see above\&.
287 .sp
288 Added in version 245\&.
289 .RE
290 .PP
291 \fBgroup\fR [\fIGROUP\fR\&...]
292 .RS 4
293 List all known group records or show details of one or more specified group records\&. Use
294 \fB\-\-output=\fR
295 to tweak the output mode\&.
296 .sp
297 If used in conjunction with
298 \fB\-\-from\-file=\fR
299 the group record data is read in JSON format from the specified file instead of querying it from the system\&. For details see above\&.
300 .sp
301 Added in version 245\&.
302 .RE
303 .PP
304 \fBusers\-in\-group\fR [\fIGROUP\fR\&...]
305 .RS 4
306 List users that are members of the specified groups\&. If no groups are specified, list all user/group memberships defined\&. Use
307 \fB\-\-output=\fR
308 to tweak the output mode\&.
309 .sp
310 Added in version 245\&.
311 .RE
312 .PP
313 \fBgroups\-of\-user\fR [\fIUSER\fR\&...]
314 .RS 4
315 Lists groups that the specified users are members of\&. If no users are specified, lists all user/group memberships defined (in this case,
316 \fBgroups\-of\-user\fR
317 and
318 \fBusers\-in\-group\fR
319 are equivalent)\&. Use
320 \fB\-\-output=\fR
321 to tweak the output mode\&.
322 .sp
323 Added in version 245\&.
324 .RE
325 .PP
326 \fBservices\fR
327 .RS 4
328 List all services currently providing user/group definitions to the system\&. See below for a list of well\-known services providing user information\&.
329 .sp
330 Added in version 245\&.
331 .RE
332 .PP
333 \fBssh\-authorized\-keys\fR
334 .RS 4
335 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\&.
336 .sp
337 Added in version 245\&.
338 .RE
339 .PP
340 \fBload\-credentials\fR
341 .RS 4
342 When specified, the following credentials are used when passed in:
343 .PP
344 \fIuserdb\&.user\&.*\fR, \fIuserdb\&.group\&.*\fR
345 .RS 4
346 These credentials should contain valid
347 \m[blue]\fBJSON User\fR\m[]\&\s-2\u[1]\d\s+2
348 and
349 \m[blue]\fBJSON Group\fR\m[]\&\s-2\u[2]\d\s+2
350 records\&. For each matching credential, various files are created in
351 /etc/userdb/, implementing the interface described in
352 \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
353 "userdb\&.user\&.foobar"
354 the suffix is
355 "foobar") must match the user or group name encoded in the record\&.
356 .sp
357 Added in version 258\&.
358 .RE
359 .sp
360 Added in version 258\&.
361 .RE
362 .SH "WELL\-KNOWN SERVICES"
363 .PP
364 The
365 \fBuserdbctl services\fR
366 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:
367 .PP
368 \fBio\&.systemd\&.DynamicUser\fR
369 .RS 4
370 This service is provided by the system service manager itself (i\&.e\&. PID 1) and makes all users (and their groups) synthesized through the
371 \fIDynamicUser=\fR
372 setting in service unit files available to the system (see
373 \fBsystemd.exec\fR(5)
374 for details about this setting)\&.
375 .sp
376 Added in version 245\&.
377 .RE
378 .PP
379 \fBio\&.systemd\&.Home\fR
380 .RS 4
381 This service is provided by
382 \fBsystemd-homed.service\fR(8)
383 and makes all users (and their groups) belonging to home directories managed by that service available to the system\&.
384 .sp
385 Added in version 245\&.
386 .RE
387 .PP
388 \fBio\&.systemd\&.Machine\fR
389 .RS 4
390 This service is provided by
391 \fBsystemd-machined.service\fR(8)
392 and synthesizes records for all users/groups used by a container that employs user namespacing\&.
393 .sp
394 Added in version 246\&.
395 .RE
396 .PP
397 \fBio\&.systemd\&.Multiplexer\fR
398 .RS 4
399 This service is provided by
400 \fBsystemd-userdbd.service\fR(8)
401 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\&.
402 \fBuserdbctl\fR
403 uses this service preferably, too, unless
404 \fB\-\-with\-nss=\fR
405 or
406 \fB\-\-service=\fR
407 are used, in which case finer control over the services to talk to is required\&.
408 .sp
409 Added in version 245\&.
410 .RE
411 .PP
412 \fBio\&.systemd\&.NameServiceSwitch\fR
413 .RS 4
414 This service is (also) provided by
415 \fBsystemd-userdbd.service\fR(8)
416 and converts classic NSS/glibc user and group records to JSON user/group records, providing full backwards compatibility\&. Use
417 \fB\-\-with\-nss=no\fR
418 to disable this compatibility, see above\&. Note that compatibility is actually provided in both directions:
419 \fBnss-systemd\fR(8)
420 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\&.
421 .sp
422 Added in version 245\&.
423 .RE
424 .PP
425 \fBio\&.systemd\&.DropIn\fR
426 .RS 4
427 This service is (also) provided by
428 \fBsystemd-userdbd.service\fR(8)
429 and picks up JSON user/group records from
430 /etc/userdb/,
431 /run/userdb/,
432 /run/host/userdb/,
433 /usr/lib/userdb/\&.
434 .sp
435 Added in version 249\&.
436 .RE
437 .PP
438 Note that
439 \fBuserdbctl\fR
440 has internal support for NSS\-based lookups too\&. This means that if neither
441 \fBio\&.systemd\&.Multiplexer\fR
442 nor
443 \fBio\&.systemd\&.NameServiceSwitch\fR
444 are running, look\-ups into the basic user/group databases will still work\&.
445 .SH "INTEGRATION WITH SSH"
446 .PP
447 The
448 \fBuserdbctl\fR
449 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
450 \fBsshd_config\fR(5):
451 .sp
452 .if n \{\
453 .RS 4
454 .\}
455 .nf
456 \&...
457 AuthorizedKeysCommand /usr/bin/userdbctl ssh\-authorized\-keys %u
458 AuthorizedKeysCommandUser root
459 \&...
460 .fi
461 .if n \{\
462 .RE
463 .\}
464 .PP
465 Sometimes, it is useful to allow chain invocation of another program to list SSH authorized keys\&. By using the
466 \fB\-\-chain\fR
467 option, such a tool may be chain executed by
468 \fBuserdbctl ssh\-authorized\-keys\fR
469 once a lookup completes, regardless of whether an SSH key was found or not\&. Example:
470 .sp
471 .if n \{\
472 .RS 4
473 .\}
474 .nf
475 \&...
476 AuthorizedKeysCommand /usr/bin/userdbctl ssh\-authorized\-keys %u \-\-chain /usr/bin/othertool %u
477 AuthorizedKeysCommandUser root
478 \&...
479 .fi
480 .if n \{\
481 .RE
482 .\}
483 .PP
484 The above will first query the userdb database for SSH keys, and then chain execute
485 \fB/usr/bin/othertool\fR
486 to also be queried\&.
487 .SH "EXIT STATUS"
488 .PP
489 On success, 0 is returned, and a non\-zero failure code otherwise\&.
490 .SH "ENVIRONMENT"
491 .PP
492 \fI$SYSTEMD_LOG_LEVEL\fR
493 .RS 4
494 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)
495 \fBemerg\fR,
496 \fBalert\fR,
497 \fBcrit\fR,
498 \fBerr\fR,
499 \fBwarning\fR,
500 \fBnotice\fR,
501 \fBinfo\fR,
502 \fBdebug\fR, or an integer in the range 0\&...7\&. See
503 \fBsyslog\fR(3)
504 for more information\&. Each value may optionally be prefixed with one of
505 \fBconsole\fR,
506 \fBsyslog\fR,
507 \fBkmsg\fR
508 or
509 \fBjournal\fR
510 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
511 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
512 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\&.
513 .RE
514 .PP
515 \fI$SYSTEMD_LOG_COLOR\fR
516 .RS 4
517 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
518 .sp
519 This setting is only useful when messages are written directly to the terminal, because
520 \fBjournalctl\fR(1)
521 and other tools that display logs will color messages based on the log level on their own\&.
522 .RE
523 .PP
524 \fI$SYSTEMD_LOG_TIME\fR
525 .RS 4
526 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
527 .sp
528 This setting is only useful when messages are written directly to the terminal or a file, because
529 \fBjournalctl\fR(1)
530 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
531 .RE
532 .PP
533 \fI$SYSTEMD_LOG_LOCATION\fR
534 .RS 4
535 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
536 .sp
537 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\&.
538 .RE
539 .PP
540 \fI$SYSTEMD_LOG_TID\fR
541 .RS 4
542 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
543 .sp
544 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\&.
545 .RE
546 .PP
547 \fI$SYSTEMD_LOG_TARGET\fR
548 .RS 4
549 The destination for log messages\&. One of
550 \fBconsole\fR
551 (log to the attached tty),
552 \fBconsole\-prefixed\fR
553 (log to the attached tty but with prefixes encoding the log level and "facility", see
554 \fBsyslog\fR(3),
555 \fBkmsg\fR
556 (log to the kernel circular log buffer),
557 \fBjournal\fR
558 (log to the journal),
559 \fBjournal\-or\-kmsg\fR
560 (log to the journal if available, and to kmsg otherwise),
561 \fBauto\fR
562 (determine the appropriate log target automatically, the default),
563 \fBnull\fR
564 (disable log output)\&.
565 .RE
566 .PP
567 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
568 .RS 4
569 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
570 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
571 .RE
572 .PP
573 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
574 .RS 4
575 Pager to use when
576 \fB\-\-no\-pager\fR
577 is not given\&.
578 \fI$SYSTEMD_PAGER\fR
579 is used if set; otherwise
580 \fI$PAGER\fR
581 is used\&. If neither
582 \fI$SYSTEMD_PAGER\fR
583 nor
584 \fI$PAGER\fR
585 are set, a set of well\-known pager implementations is tried in turn, including
586 \fBless\fR(1)
587 and
588 \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
589 "cat"
590 is equivalent to passing
591 \fB\-\-no\-pager\fR\&.
592 .sp
593 Note: if
594 \fI$SYSTEMD_PAGERSECURE\fR
595 is not set,
596 \fI$SYSTEMD_PAGER\fR
597 and
598 \fI$PAGER\fR
599 can only be used to disable the pager (with
600 "cat"
601 or
602 ""), and are otherwise ignored\&.
603 .RE
604 .PP
605 \fI$SYSTEMD_LESS\fR
606 .RS 4
607 Override the options passed to
608 \fBless\fR
609 (by default
610 "FRSXMK")\&.
611 .sp
612 Users might want to change two options in particular:
613 .PP
614 \fBK\fR
615 .RS 4
616 This option instructs the pager to exit immediately when
617 Ctrl+C
618 is pressed\&. To allow
619 \fBless\fR
620 to handle
621 Ctrl+C
622 itself to switch back to the pager command prompt, unset this option\&.
623 .sp
624 If the value of
625 \fI$SYSTEMD_LESS\fR
626 does not include
627 "K", and the pager that is invoked is
628 \fBless\fR,
629 Ctrl+C
630 will be ignored by the executable, and needs to be handled by the pager\&.
631 .RE
632 .PP
633 \fBX\fR
634 .RS 4
635 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\&.
636 .RE
637 .sp
638 Note that setting the regular
639 \fI$LESS\fR
640 environment variable has no effect for
641 \fBless\fR
642 invocations by systemd tools\&.
643 .sp
644 See
645 \fBless\fR(1)
646 for more discussion\&.
647 .RE
648 .PP
649 \fI$SYSTEMD_LESSCHARSET\fR
650 .RS 4
651 Override the charset passed to
652 \fBless\fR
653 (by default
654 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
655 .sp
656 Note that setting the regular
657 \fI$LESSCHARSET\fR
658 environment variable has no effect for
659 \fBless\fR
660 invocations by systemd tools\&.
661 .RE
662 .PP
663 \fI$SYSTEMD_PAGERSECURE\fR
664 .RS 4
665 Common pager commands like
666 \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
667 \fBsudo\fR(8)
668 or
669 \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,
670 \fIif the pager supports that\fR
671 (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
672 \fB\-\-no\-pager\fR
673 or
674 \fIPAGER=cat\fR
675 when allowing untrusted users to execute commands with elevated privileges\&.
676 .sp
677 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
678 \fBLESSSECURE=1\fR
679 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
680 \fBless\fR(1)
681 is known to understand this variable and implement "secure mode"\&.
682 .sp
683 When set to false, no limitation is placed on the pager\&. Setting
684 \fISYSTEMD_PAGERSECURE=0\fR
685 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
686 .sp
687 When
688 \fI$SYSTEMD_PAGERSECURE\fR
689 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
690 \fBgeteuid\fR(2)
691 and
692 \fBsd_pid_get_owner_uid\fR(3), or when running under
693 \fBsudo\fR(8)
694 or similar tools (\fI$SUDO_UID\fR
695 is set
696 \&\s-2\u[4]\d\s+2)\&. In those cases,
697 \fISYSTEMD_PAGERSECURE=1\fR
698 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
699 \fI$SYSTEMD_PAGERSECURE\fR
700 or disable the pager\&.
701 .sp
702 Note that if the
703 \fI$SYSTEMD_PAGER\fR
704 or
705 \fI$PAGER\fR
706 variables are to be honoured, other than to disable the pager,
707 \fI$SYSTEMD_PAGERSECURE\fR
708 must be set too\&.
709 .RE
710 .PP
711 \fI$SYSTEMD_COLORS\fR
712 .RS 4
713 Takes a boolean argument\&. When true,
714 \fBsystemd\fR
715 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:
716 "16",
717 "256"
718 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
719 \fI$TERM\fR
720 and what the console is connected to\&.
721 .RE
722 .PP
723 \fI$SYSTEMD_URLIFY\fR
724 .RS 4
725 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
726 \fBsystemd\fR
727 makes based on
728 \fI$TERM\fR
729 and other conditions\&.
730 .RE
731 .SH "SEE ALSO"
732 .PP
733 \fBsystemd\fR(1), \fBsystemd-userdbd.service\fR(8), \fBsystemd-homed.service\fR(8), \fBnss-systemd\fR(8), \fBgetent\fR(1)
734 .SH "NOTES"
735 .IP " 1." 4
736 JSON User Records
737 .RS 4
738 \%https://systemd.io/USER_RECORD
739 .RE
740 .IP " 2." 4
741 JSON Group Records
742 .RS 4
743 \%https://systemd.io/GROUP_RECORD
744 .RE
745 .IP " 3." 4
746 User/Group Record Lookup API via Varlink
747 .RS 4
748 \%https://systemd.io/USER_GROUP_API
749 .RE
750 .IP " 4." 4
751 It is recommended for other tools to set and check
752 \fI$SUDO_UID\fR
753 as appropriate, treating it is a common interface.
754