]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/crypttab.xml
NEWS: add warnings about read-only fs and libkmod being dlopen'ed
[thirdparty/systemd.git] / man / crypttab.xml
1 <?xml version="1.0"?>
2 <!--*-nxml-*-->
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
5 <!--
6 SPDX-License-Identifier: LGPL-2.1-or-later
7
8 This is based on crypttab(5) from Fedora's initscripts package, which in
9 turn is based on Debian's version.
10
11 The Red Hat version has been written by Miloslav Trmac <mitr@redhat.com>.
12 -->
13 <refentry id="crypttab" conditional='HAVE_LIBCRYPTSETUP' xmlns:xi="http://www.w3.org/2001/XInclude">
14
15 <refentryinfo>
16 <title>crypttab</title>
17 <productname>systemd</productname>
18 </refentryinfo>
19
20 <refmeta>
21 <refentrytitle>crypttab</refentrytitle>
22 <manvolnum>5</manvolnum>
23 </refmeta>
24
25 <refnamediv>
26 <refname>crypttab</refname>
27 <refpurpose>Configuration for encrypted block devices</refpurpose>
28 </refnamediv>
29
30 <refsynopsisdiv>
31 <para><filename>/etc/crypttab</filename></para>
32 </refsynopsisdiv>
33
34 <refsect1>
35 <title>Description</title>
36
37 <para>The <filename>/etc/crypttab</filename> file describes
38 encrypted block devices that are set up during system boot.</para>
39
40 <para>Empty lines and lines starting with the <literal>#</literal>
41 character are ignored. Each of the remaining lines describes one
42 encrypted block device. Fields are delimited by white space.</para>
43
44 <para>Each line is in the form<programlisting><replaceable>volume-name</replaceable> <replaceable>encrypted-device</replaceable> <replaceable>key-file</replaceable> <replaceable>options</replaceable></programlisting>
45 The first two fields are mandatory, the remaining two are
46 optional.</para>
47
48 <para>Setting up encrypted block devices using this file supports four encryption modes: LUKS, TrueCrypt,
49 BitLocker and plain. See <citerefentry
50 project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry> for
51 more information about each mode. When no mode is specified in the options field and the block device
52 contains a LUKS signature, it is opened as a LUKS device; otherwise, it is assumed to be in raw dm-crypt
53 (plain mode) format.</para>
54
55 <para>The four fields of <filename>/etc/crypttab</filename> are defined as follows:</para>
56
57 <orderedlist>
58
59 <listitem><para>The first field contains the name of the resulting volume with decrypted data; its
60 block device is set up below <filename>/dev/mapper/</filename>.</para></listitem>
61
62 <listitem><para>The second field contains a path to the underlying block
63 device or file, or a specification of a block device via
64 <literal>UUID=</literal> followed by the UUID.</para></listitem>
65
66 <listitem><para>The third field specifies an absolute path to a file with the encryption
67 key. Optionally, the path may be followed by <literal>:</literal> and an
68 <filename>/etc/fstab</filename> style device specification (e.g. starting with
69 <literal>LABEL=</literal> or similar); in which case the path is taken relative to the specified
70 device's file system root. If the field is not present or is <literal>none</literal> or
71 <literal>-</literal>, a key file named after the volume to unlock (i.e. the first column of the line),
72 suffixed with <filename>.key</filename> is automatically loaded from the
73 <filename>/etc/cryptsetup-keys.d/</filename> and <filename>/run/cryptsetup-keys.d/</filename>
74 directories, if present. Otherwise, the password has to be manually entered during system boot. For
75 swap encryption, <filename>/dev/urandom</filename> may be used as key file, resulting in a randomized
76 key.</para>
77
78 <para>If the specified key file path refers to an <constant>AF_UNIX</constant> stream socket in the
79 file system, the key is acquired by connecting to the socket and reading it from the connection. This
80 allows the implementation of a service to provide key information dynamically, at the moment when it is
81 needed. For details see below.</para></listitem>
82
83 <listitem><para>The fourth field, if present, is a comma-delimited list of options. The supported
84 options are listed below.</para></listitem>
85 </orderedlist>
86 </refsect1>
87
88 <refsect1>
89 <title>Key Acquisition</title>
90
91 <para>Six different mechanisms for acquiring the decryption key or passphrase unlocking the encrypted
92 volume are supported. Specifically:</para>
93
94 <orderedlist>
95
96 <listitem><para>Most prominently, the user may be queried interactively during volume activation
97 (i.e. typically at boot), asking them to type in the necessary passphrases.</para></listitem>
98
99 <listitem><para>The (unencrypted) key may be read from a file on disk, possibly on removable media. The third field
100 of each line encodes the location, for details see above.</para></listitem>
101
102 <listitem><para>The (unencrypted) key may be requested from another service, by specifying an
103 <constant>AF_UNIX</constant> file system socket in place of a key file in the third field. For details
104 see above and below.</para></listitem>
105
106 <listitem><para>The key may be acquired via a PKCS#11 compatible hardware security token or
107 smartcard. In this case a saved key used in unlock process is stored on disk/removable media, acquired via
108 <constant>AF_UNIX</constant>, or stored in the LUKS2 JSON token metadata header. For RSA, the saved key
109 is an encrypted volume key. The encrypted volume key is then decrypted by the PKCS#11 token with an RSA
110 private key stored on it, and used to unlock the encrypted volume. For elliptic-curve (EC) cryptography,
111 the saved key is the public key generated in enrollment process. The public key is then used to derive
112 a shared secret with a private key stored in the PKCS#11 token. The derived shared secret is then used
113 to unlock the volume. Use the <option>pkcs11-uri=</option> option described below to use this mechanism.
114 </para></listitem>
115
116 <listitem><para>Similarly, the key may be acquired via a FIDO2 compatible hardware security token
117 (which must implement the "hmac-secret" extension). In this case a key generated randomly during
118 enrollment is stored on disk/removable media, acquired via <constant>AF_UNIX</constant>, or stored in
119 the LUKS2 JSON token metadata header. The random key is hashed via a keyed hash function (HMAC) on the
120 FIDO2 token, using a secret key stored on the token that never leaves it. The resulting hash value is
121 then used as key to unlock the encrypted volume. Use the <option>fido2-device=</option> option
122 described below to use this mechanism.</para></listitem>
123
124 <listitem><para>Similarly, the key may be acquired via a TPM2 security chip. In this case a (during
125 enrollment) randomly generated key — encrypted by an asymmetric key derived from the TPM2 chip's seed
126 key — is stored on disk/removable media, acquired via <constant>AF_UNIX</constant>, or stored in the
127 LUKS2 JSON token metadata header. Use the <option>tpm2-device=</option> option described below to use
128 this mechanism.</para></listitem>
129 </orderedlist>
130
131 <para>For the latter five mechanisms the source for the key material used for unlocking the volume is
132 primarily configured in the third field of each <filename>/etc/crypttab</filename> line, but may also
133 be configured in <filename>/etc/cryptsetup-keys.d/</filename> and
134 <filename>/run/cryptsetup-keys.d/</filename> (see above) or in the LUKS2 JSON token header (in case of
135 the latter three). Use the
136 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
137 tool to enroll PKCS#11, FIDO2 and TPM2 devices in LUKS2 volumes.</para>
138 </refsect1>
139
140 <refsect1>
141 <title>Supported Options</title>
142
143 <para>The following options may be used in the fourth field of each line:</para>
144
145 <variablelist class='fstab-options'>
146
147 <varlistentry>
148 <term><option>cipher=</option></term>
149
150 <listitem><para>Specifies the cipher to use. See <citerefentry
151 project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
152 for possible values and the default value of this option. A cipher with unpredictable IV values, such
153 as <literal>aes-cbc-essiv:sha256</literal>, is recommended. Embedded commas in the cipher
154 specification need to be escaped by preceding them with a backslash, see example below.</para>
155
156 <xi:include href="version-info.xml" xpointer="v186"/>
157 </listitem>
158 </varlistentry>
159
160 <varlistentry>
161 <term><option>discard</option></term>
162
163 <listitem><para>Allow discard requests to be passed through the encrypted block
164 device. This improves performance on SSD storage but has security implications.
165 </para>
166
167 <xi:include href="version-info.xml" xpointer="v207"/></listitem>
168 </varlistentry>
169
170 <varlistentry>
171 <term><option>hash=</option></term>
172
173 <listitem><para>Specifies the hash to use for password
174 hashing. See
175 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
176 for possible values and the default value of this
177 option.</para>
178
179 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
180 </varlistentry>
181
182 <varlistentry>
183 <term><option>header=</option></term>
184
185 <listitem><para>Use a detached (separated) metadata device or file
186 where the header containing the master key(s) is stored. This
187 option is only relevant for LUKS and TrueCrypt/VeraCrypt devices. See
188 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
189 for possible values and the default value of this option.</para>
190
191 <para>Optionally, the path may be followed by <literal>:</literal> and an
192 <filename>/etc/fstab</filename> device specification (e.g. starting with <literal>UUID=</literal> or
193 similar); in which case, the path is relative to the device file system root. The device gets mounted
194 automatically for LUKS device activation duration only.</para>
195
196 <xi:include href="version-info.xml" xpointer="v219"/></listitem>
197 </varlistentry>
198
199 <varlistentry>
200 <term><option>keyfile-offset=</option></term>
201
202 <listitem><para>Specifies the number of bytes to skip at the
203 start of the key file. See
204 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
205 for possible values and the default value of this
206 option.</para>
207
208 <xi:include href="version-info.xml" xpointer="v187"/></listitem>
209 </varlistentry>
210
211 <varlistentry>
212 <term><option>keyfile-size=</option></term>
213
214 <listitem><para>Specifies the maximum number of bytes to read
215 from the key file. See
216 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
217 for possible values and the default value of this option. This
218 option is ignored in plain encryption mode, as the key file
219 size is then given by the key size.</para>
220
221 <xi:include href="version-info.xml" xpointer="v188"/></listitem>
222 </varlistentry>
223
224 <varlistentry>
225 <term><option>keyfile-erase</option></term>
226
227 <listitem><para>If enabled, the specified key file is erased after the volume is activated or when
228 activation fails. This is in particular useful when the key file is only acquired transiently before
229 activation (e.g. via a file in <filename>/run/</filename>, generated by a service running before
230 activation), and shall be removed after use. Defaults to off.</para>
231
232 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
233 </varlistentry>
234
235 <varlistentry>
236 <term><option>key-slot=</option></term>
237
238 <listitem><para>Specifies the key slot to compare the
239 passphrase or key against. If the key slot does not match the
240 given passphrase or key, but another would, the setup of the
241 device will fail regardless. This option implies
242 <option>luks</option>. See
243 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
244 for possible values. The default is to try all key slots in
245 sequential order.</para>
246
247 <xi:include href="version-info.xml" xpointer="v209"/></listitem>
248 </varlistentry>
249
250 <varlistentry>
251 <term><option>keyfile-timeout=</option></term>
252
253 <listitem><para> Specifies the timeout for the device on
254 which the key file resides or the device used as the key file,
255 and falls back to a password if it could not be accessed. See
256 <citerefentry><refentrytitle>systemd-cryptsetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
257 for key files on external devices.
258 </para>
259
260 <xi:include href="version-info.xml" xpointer="v243"/></listitem>
261 </varlistentry>
262
263 <varlistentry>
264 <term><option>link-volume-key=</option></term>
265
266 <listitem><para>Specifies the kernel keyring and key description
267 (see <citerefentry project='man-pages'><refentrytitle>keyrings</refentrytitle><manvolnum>7</manvolnum></citerefentry>)
268 where LUKS2 volume key gets linked during device activation. The kernel keyring
269 description and key description must be separated by <literal>::</literal>.</para>
270
271 <para>The kernel keyring part can be a string description or a predefined
272 kernel keyring prefixed with <literal>@</literal> (e.g.: to use <literal>@s</literal> session or
273 <literal>@u</literal> user keyring directly). The type prefix text in the kernel keyring description
274 is not required. The specified kernel keyring must already exist at the time of device activation.</para>
275
276 <para>The key part is a string description optionally prefixed by a <literal>%key_type:</literal>.
277 If no type is specified, the <literal>user</literal> type key is linked by default. See
278 <citerefentry project='man-pages'><refentrytitle>keyctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
279 for more information on key descriptions (KEY IDENTIFIERS section).</para>
280
281 <para>Note that the linked volume key is not cleaned up automatically when the device is detached.</para>
282
283 <xi:include href="version-info.xml" xpointer="v256"/></listitem>
284 </varlistentry>
285
286 <varlistentry>
287 <term><option>luks</option></term>
288
289 <listitem><para>Force LUKS mode. When this mode is used, the
290 following options are ignored since they are provided by the
291 LUKS header on the device: <option>cipher=</option>,
292 <option>hash=</option>,
293 <option>size=</option>.</para>
294
295 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
296 </varlistentry>
297
298 <varlistentry>
299 <term><option>bitlk</option></term>
300
301 <listitem><para>Decrypt BitLocker drive. Encryption parameters
302 are deduced by cryptsetup from BitLocker header.</para>
303
304 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
305 </varlistentry>
306
307 <varlistentry>
308 <term><option>_netdev</option></term>
309
310 <listitem><para>Marks this cryptsetup device as requiring network. It will be
311 started after the network is available, similarly to
312 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
313 units marked with <option>_netdev</option>. The service unit to set up this device
314 will be ordered between <filename>remote-fs-pre.target</filename> and
315 <filename>remote-cryptsetup.target</filename>, instead of
316 <filename>cryptsetup-pre.target</filename> and
317 <filename>cryptsetup.target</filename>.</para>
318
319 <para>Hint: if this device is used for a mount point that is specified in
320 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
321 the <option>_netdev</option> option should also be used for the mount
322 point. Otherwise, a dependency loop might be created where the mount point
323 will be pulled in by <filename>local-fs.target</filename>, while the
324 service to configure the network is usually only started <emphasis>after</emphasis>
325 the local file system has been mounted.</para>
326
327 <xi:include href="version-info.xml" xpointer="v235"/>
328 </listitem>
329 </varlistentry>
330
331 <varlistentry>
332 <term><option>noauto</option></term>
333
334 <listitem><para>This device will not be added to <filename>cryptsetup.target</filename>.
335 This means that it will not be automatically unlocked on boot, unless something else pulls
336 it in. In particular, if the device is used for a mount point, it'll be unlocked
337 automatically during boot, unless the mount point itself is also disabled with
338 <option>noauto</option>.</para>
339
340 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
341 </varlistentry>
342
343 <varlistentry>
344 <term><option>nofail</option></term>
345
346 <listitem><para>This device will not be a hard dependency of
347 <filename>cryptsetup.target</filename>. It'll still be pulled in and started, but the system
348 will not wait for the device to show up and be unlocked, and boot will not fail if this is
349 unsuccessful. Note that other units that depend on the unlocked device may still fail. In
350 particular, if the device is used for a mount point, the mount point itself also needs to
351 have the <option>nofail</option> option, or the boot will fail if the device is not unlocked
352 successfully. If a keyfile and/or a <option>header</option> are specified, the dependencies on
353 their respective directories will also not be fatal, so that umounting said directories will
354 not cause the generated cryptset unit to be deactivated.</para>
355
356 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
357 </varlistentry>
358
359 <varlistentry>
360 <term><option>offset=</option></term>
361
362 <listitem><para>Start offset in the backend device, in 512-byte sectors. This
363 option is only relevant for plain devices.</para>
364
365 <xi:include href="version-info.xml" xpointer="v220"/></listitem>
366 </varlistentry>
367
368 <varlistentry>
369 <term><option>plain</option></term>
370
371 <listitem><para>Force plain encryption mode.</para>
372
373 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
374 </varlistentry>
375
376 <varlistentry>
377 <term><option>read-only</option></term><term><option>readonly</option></term>
378
379 <listitem><para>Set up the encrypted block device in read-only
380 mode.</para>
381
382 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
383 </varlistentry>
384
385 <varlistentry>
386 <term><option>same-cpu-crypt</option></term>
387
388 <listitem><para>Perform encryption using the same CPU that IO was submitted on. The default is to use
389 an unbound workqueue so that encryption work is automatically balanced between available CPUs.</para>
390
391 <para>This requires kernel 4.0 or newer.</para>
392
393 <xi:include href="version-info.xml" xpointer="v242"/>
394 </listitem>
395 </varlistentry>
396
397 <varlistentry>
398 <term><option>submit-from-crypt-cpus</option></term>
399
400 <listitem><para>Disable offloading writes to a separate thread after encryption. There are some
401 situations where offloading write requests from the encryption threads to a dedicated thread degrades
402 performance significantly. The default is to offload write requests to a dedicated thread because it
403 benefits the CFQ scheduler to have writes submitted using the same context.</para>
404
405 <para>This requires kernel 4.0 or newer.</para>
406
407 <xi:include href="version-info.xml" xpointer="v242"/>
408 </listitem>
409 </varlistentry>
410
411 <varlistentry>
412 <term><option>no-read-workqueue</option></term>
413
414 <listitem><para>Bypass dm-crypt internal workqueue and process read requests synchronously. The
415 default is to queue these requests and process them asynchronously.</para>
416
417 <para>This requires kernel 5.9 or newer.</para>
418
419 <xi:include href="version-info.xml" xpointer="v248"/>
420 </listitem>
421 </varlistentry>
422 <varlistentry>
423 <term><option>no-write-workqueue</option></term>
424
425 <listitem><para>Bypass dm-crypt internal workqueue and process write requests synchronously. The
426 default is to queue these requests and process them asynchronously.</para>
427
428 <para>This requires kernel 5.9 or newer.</para>
429
430 <xi:include href="version-info.xml" xpointer="v248"/>
431 </listitem>
432 </varlistentry>
433
434 <varlistentry>
435 <term><option>skip=</option></term>
436
437 <listitem><para>How many 512-byte sectors of the encrypted data to skip at the
438 beginning. This is different from the <option>offset=</option> option with respect
439 to the sector numbers used in initialization vector (IV) calculation. Using
440 <option>offset=</option> will shift the IV calculation by the same negative
441 amount. Hence, if <option>offset=<replaceable>n</replaceable></option> is given,
442 sector <replaceable>n</replaceable> will get a sector number of 0 for the IV
443 calculation. Using <option>skip=</option> causes sector
444 <replaceable>n</replaceable> to also be the first sector of the mapped device, but
445 with its number for IV generation being <replaceable>n</replaceable>.</para>
446
447 <para>This option is only relevant for plain devices.</para>
448
449 <xi:include href="version-info.xml" xpointer="v220"/>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry>
454 <term><option>size=</option></term>
455
456 <listitem><para>Specifies the key size in bits. See
457 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
458 for possible values and the default value of this
459 option.</para>
460
461 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
462 </varlistentry>
463
464 <varlistentry>
465 <term><option>sector-size=</option></term>
466
467 <listitem><para>Specifies the sector size in bytes. See
468 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
469 for possible values and the default value of this
470 option.</para>
471
472 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
473 </varlistentry>
474
475 <varlistentry>
476 <term><option>swap</option></term>
477
478 <listitem><para>The encrypted block device will be used as a
479 swap device, and will be formatted accordingly after setting
480 up the encrypted block device, with
481 <citerefentry project='man-pages'><refentrytitle>mkswap</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
482 This option implies <option>plain</option>.</para>
483
484 <warning>
485 <para>Using the <option>swap</option> option will
486 destroy the contents of the named partition during every boot,
487 so make sure the underlying block device is specified
488 correctly.</para>
489 </warning>
490
491 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
492 </varlistentry>
493
494 <varlistentry>
495 <term><option>tcrypt</option></term>
496
497 <listitem><para>Use TrueCrypt encryption mode. When this mode
498 is used, the following options are ignored since they are
499 provided by the TrueCrypt header on the device or do not
500 apply:
501 <option>cipher=</option>,
502 <option>hash=</option>,
503 <option>keyfile-offset=</option>,
504 <option>keyfile-size=</option>,
505 <option>size=</option>.</para>
506
507 <para>When this mode is used, the passphrase is read from the
508 key file given in the third field. Only the first line of this
509 file is read, excluding the new line character.</para>
510
511 <para>Note that the TrueCrypt format uses both passphrase and
512 key files to derive a password for the volume. Therefore, the
513 passphrase and all key files need to be provided. Use
514 <option>tcrypt-keyfile=</option> to provide the absolute path
515 to all key files. When using an empty passphrase in
516 combination with one or more key files, use
517 <literal>/dev/null</literal> as the password file in the third
518 field.</para>
519
520 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
521 </varlistentry>
522
523 <varlistentry>
524 <term><option>tcrypt-hidden</option></term>
525
526 <listitem><para>Use the hidden TrueCrypt volume. This option
527 implies <option>tcrypt</option>.</para>
528
529 <para>This will map the hidden volume that is inside of the
530 volume provided in the second field. Please note that there is
531 no protection for the hidden volume if the outer volume is
532 mounted instead. See
533 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
534 for more information on this limitation.</para>
535
536 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
537 </varlistentry>
538
539 <varlistentry>
540 <term><option>tcrypt-keyfile=</option></term>
541
542 <listitem><para>Specifies the absolute path to a key file to
543 use for a TrueCrypt volume. This implies
544 <option>tcrypt</option> and can be used more than once to
545 provide several key files.</para>
546
547 <para>See the entry for <option>tcrypt</option> on the
548 behavior of the passphrase and key files when using TrueCrypt
549 encryption mode.</para>
550
551 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
552 </varlistentry>
553
554 <varlistentry>
555 <term><option>tcrypt-system</option></term>
556
557 <listitem><para>Use TrueCrypt in system encryption mode. This
558 option implies <option>tcrypt</option>.</para>
559
560 <xi:include href="version-info.xml" xpointer="v206"/></listitem>
561 </varlistentry>
562
563 <varlistentry>
564 <term><option>tcrypt-veracrypt</option></term>
565
566 <listitem><para>Check for a VeraCrypt volume. VeraCrypt is a fork of
567 TrueCrypt that is mostly compatible, but uses different, stronger key
568 derivation algorithms that cannot be detected without this flag.
569 Enabling this option could substantially slow down unlocking, because
570 VeraCrypt's key derivation takes much longer than TrueCrypt's. This
571 option implies <option>tcrypt</option>.</para>
572
573 <xi:include href="version-info.xml" xpointer="v232"/></listitem>
574 </varlistentry>
575
576 <varlistentry>
577 <term><option>veracrypt-pim=</option></term>
578
579 <listitem><para>Specifies a custom Personal Iteration Multiplier (PIM)
580 value, which can range from 0..2147468 for standard veracrypt volumes
581 and 0..65535 for veracrypt system volumes. A value of 0 will imply the
582 VeraCrypt default.
583
584 This option is only effective when <option>tcrypt-veracrypt</option> is
585 set.</para>
586
587 <para>Note that VeraCrypt enforces a minimal allowed PIM value depending on the
588 password strength and the hash algorithm used for key derivation, however
589 <option>veracrypt-pim=</option> is not checked against these bounds.
590 See
591 <ulink url="https://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20%28PIM%29.html">Veracrypt Personal Iterations Multiplier</ulink>
592 documentation for more information.</para>
593
594 <xi:include href="version-info.xml" xpointer="v254"/>
595 </listitem>
596 </varlistentry>
597
598 <varlistentry>
599 <term><option>timeout=</option></term>
600
601 <listitem><para>Specifies the timeout for querying for a
602 password. If no unit is specified, seconds is used. Supported
603 units are s, ms, us, min, h, d. A timeout of 0 waits
604 indefinitely (which is the default).</para>
605
606 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
607 </varlistentry>
608
609 <varlistentry>
610 <term><option>tmp=</option></term>
611
612 <listitem><para>The encrypted block device will be prepared for using it as
613 <filename>/tmp/</filename>; it will be formatted using <citerefentry
614 project='man-pages'><refentrytitle>mkfs</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Takes
615 a file system type as argument, such as <literal>ext4</literal>, <literal>xfs</literal> or
616 <literal>btrfs</literal>. If no argument is specified defaults to <literal>ext4</literal>. This
617 option implies <option>plain</option>.</para>
618
619 <warning>
620 <para>Using the <option>tmp</option> option will destroy the contents of the named partition
621 during every boot, so make sure the underlying block device is specified correctly.</para>
622 </warning>
623
624 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
625 </varlistentry>
626
627 <varlistentry>
628 <term><option>tries=</option></term>
629
630 <listitem><para>Specifies the maximum number of times the user
631 is queried for a password. The default is 3. If set to 0, the
632 user is queried for a password indefinitely.</para>
633
634 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
635 </varlistentry>
636
637 <varlistentry>
638 <term><option>headless=</option></term>
639
640 <listitem><para>Takes a boolean argument, defaults to false. If true, never query interactively
641 for the password/PIN. Useful for headless systems.</para>
642
643 <xi:include href="version-info.xml" xpointer="v249"/></listitem>
644 </varlistentry>
645
646 <varlistentry>
647 <term><option>verify</option></term>
648
649 <listitem><para>If the encryption password is read from console, it has to be entered twice to
650 prevent typos.</para>
651
652 <xi:include href="version-info.xml" xpointer="v186"/></listitem>
653 </varlistentry>
654
655 <varlistentry>
656 <term><option>password-echo=yes|no|masked</option></term>
657
658 <listitem><para>Controls whether to echo passwords or security token PINs
659 that are read from console. Takes a boolean or the special string <literal>masked</literal>.
660 The default is <option>password-echo=masked</option>.</para>
661
662 <para>If enabled, the typed characters are echoed literally. If disabled,
663 the typed characters are not echoed in any form, the user will not get
664 feedback on their input. If set to <literal>masked</literal>, an asterisk
665 (<literal>*</literal>) is echoed for each character typed. Regardless of
666 which mode is chosen, if the user hits the tabulator key (<literal></literal>)
667 at any time, or the backspace key (<literal></literal>) before any other
668 data has been entered, then echo is turned off.</para>
669
670 <xi:include href="version-info.xml" xpointer="v249"/></listitem>
671 </varlistentry>
672
673 <varlistentry>
674 <term><option>pkcs11-uri=</option></term>
675
676 <listitem><para>Takes either the special value <literal>auto</literal> or an <ulink
677 url="https://tools.ietf.org/html/rfc7512">RFC7512 PKCS#11 URI</ulink> pointing to a private key
678 which is used to decrypt the encrypted key specified in the third column of the line. This is useful
679 for unlocking encrypted volumes through PKCS#11 compatible security tokens or smartcards. See below
680 for an example how to set up this mechanism for unlocking a LUKS2 volume with a YubiKey security
681 token.</para>
682
683 <para>If specified as <literal>auto</literal> the volume must be of type LUKS2 and must carry PKCS#11
684 security token metadata in its LUKS2 JSON token section. In this mode the URI and the encrypted key
685 are automatically read from the LUKS2 JSON token header. Use
686 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
687 as a simple tool for enrolling PKCS#11 security tokens or smartcards in a way compatible with
688 <literal>auto</literal>. In this mode the third column of the line should remain empty (that is,
689 specified as <literal>-</literal>).</para>
690
691 <para>The specified URI can refer directly to a private key stored on a token or alternatively
692 just to a slot or token, in which case a search for a suitable private key will be performed. In
693 this case if multiple suitable objects are found the token is refused. The keyfile configured
694 in the third column of the line is used as is (i.e. in binary form, unprocessed). The resulting
695 decrypted key (for RSA) or derived shared secret (for ECC) is then Base64 encoded before it is used
696 to unlock the LUKS volume.</para>
697
698 <para>Use <command>systemd-cryptenroll --pkcs11-token-uri=list</command> to list all suitable PKCS#11
699 security tokens currently plugged in, along with their URIs.</para>
700
701 <para>Note that many newer security tokens that may be used as PKCS#11 security token typically also
702 implement the newer and simpler FIDO2 standard. Consider using <option>fido2-device=</option>
703 (described below) to enroll it via FIDO2 instead. Note that a security token enrolled via PKCS#11
704 cannot be used to unlock the volume via FIDO2, unless also enrolled via FIDO2, and vice
705 versa.</para>
706
707 <xi:include href="version-info.xml" xpointer="v245"/></listitem>
708 </varlistentry>
709
710 <varlistentry>
711 <term><option>fido2-device=</option></term>
712
713 <listitem><para>Takes either the special value <literal>auto</literal> or the path to a
714 <literal>hidraw</literal> device node (e.g. <filename>/dev/hidraw1</filename>) referring to a FIDO2
715 security token that implements the <literal>hmac-secret</literal> extension (most current hardware
716 security tokens do). See below for an example how to set up this mechanism for unlocking an encrypted
717 volume with a FIDO2 security token.</para>
718
719 <para>If specified as <literal>auto</literal> the FIDO2 token device is automatically discovered, as
720 it is plugged in.</para>
721
722 <para>FIDO2 volume unlocking requires a client ID hash (CID) to be configured via
723 <option>fido2-cid=</option> (see below) and a key to pass to the security token's HMAC functionality
724 (configured in the line's third column) to operate. If not configured and the volume is of type
725 LUKS2, the CID and the key are read from LUKS2 JSON token metadata instead. Use
726 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
727 as simple tool for enrolling FIDO2 security tokens, compatible with this automatic mode, which is
728 only available for LUKS2 volumes.</para>
729
730 <para>Use <command>systemd-cryptenroll --fido2-device=list</command> to list all suitable FIDO2
731 security tokens currently plugged in, along with their device nodes.</para>
732
733 <para>This option implements the following mechanism: the configured key is hashed via they HMAC
734 keyed hash function the FIDO2 device implements, keyed by a secret key embedded on the device. The
735 resulting hash value is Base64 encoded and used to unlock the LUKS2 volume. As it should not be
736 possible to extract the secret from the hardware token, it should not be possible to retrieve the
737 hashed key given the configured key — without possessing the hardware token.</para>
738
739 <para>Note that many security tokens that implement FIDO2 also implement PKCS#11, suitable for
740 unlocking volumes via the <option>pkcs11-uri=</option> option described above. Typically the newer,
741 simpler FIDO2 standard is preferable.</para>
742
743 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
744 </varlistentry>
745
746 <varlistentry>
747 <term><option>fido2-cid=</option></term>
748
749 <listitem><para>Takes a Base64 encoded FIDO2 client ID to use for the FIDO2 unlock operation. If
750 specified, but <option>fido2-device=</option> is not, <option>fido2-device=auto</option> is
751 implied. If <option>fido2-device=</option> is used but <option>fido2-cid=</option> is not, the volume
752 must be of LUKS2 type, and the CID is read from the LUKS2 JSON token header. Use
753 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
754 for enrolling a FIDO2 token in the LUKS2 header compatible with this automatic
755 mode.</para>
756
757 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
758 </varlistentry>
759
760 <varlistentry>
761 <term><option>fido2-rp=</option></term>
762
763 <listitem><para>Takes a string, configuring the FIDO2 Relying Party (rp) for the FIDO2 unlock
764 operation. If not specified <literal>io.systemd.cryptsetup</literal> is used, except if the LUKS2
765 JSON token header contains a different value. It should normally not be necessary to override
766 this.</para>
767
768 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
769 </varlistentry>
770
771 <varlistentry>
772 <term><option>tpm2-device=</option></term>
773
774 <listitem><para>Takes either the special value <literal>auto</literal> or the path to a device node
775 (e.g. <filename>/dev/tpmrm0</filename>) referring to a TPM2 security chip. See below for an example
776 how to set up this mechanism for unlocking an encrypted volume with a TPM2 chip.</para>
777
778 <para>Use <option>tpm2-pcrs=</option> (see below) to configure the set of TPM2 PCRs to bind the
779 volume unlocking to. Use
780 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
781 as simple tool for enrolling TPM2 security chips in LUKS2 volumes.</para>
782
783 <para>If specified as <literal>auto</literal> the TPM2 device is automatically discovered. Use
784 <command>systemd-cryptenroll --tpm2-device=list</command> to list all suitable TPM2 devices currently
785 available, along with their device nodes.</para>
786
787 <para>This option implements the following mechanism: when enrolling a TPM2 device via
788 <command>systemd-cryptenroll</command> on a LUKS2 volume, a randomized key unlocking the volume is
789 generated on the host and loaded into the TPM2 chip where it is encrypted with an asymmetric
790 "primary" key pair derived from the TPM2's internal "seed" key. Neither the seed key nor the primary
791 key are permitted to ever leave the TPM2 chip — however, the now encrypted randomized key may. It is
792 saved in the LUKS2 volume JSON token header. When unlocking the encrypted volume, the primary key
793 pair is generated on the TPM2 chip again (which works as long as the chip's seed key is correctly
794 maintained by the TPM2 chip), which is then used to decrypt (on the TPM2 chip) the encrypted key from
795 the LUKS2 volume JSON token header saved there during enrollment. The resulting decrypted key is then
796 used to unlock the volume. When the randomized key is encrypted the current values of the selected
797 PCRs (see below) are included in the operation, so that different PCR state results in different
798 encrypted keys and the decrypted key can only be recovered if the same PCR state is
799 reproduced.</para>
800
801 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
802 </varlistentry>
803
804 <varlistentry>
805 <term><option>tpm2-pcrs=</option></term>
806
807 <listitem><para>Takes a <literal>+</literal> separated list of numeric TPM2 PCR (i.e. "Platform
808 Configuration Register") indexes to bind the TPM2 volume unlocking to. This option is only useful
809 when TPM2 enrollment metadata is not available in the LUKS2 JSON token header already, the way
810 <command>systemd-cryptenroll</command> writes it there. If not used (and no metadata in the LUKS2
811 JSON token header defines it), defaults to a list of a single entry: PCR 7. Assign an empty string to
812 encode a policy that binds the key to no PCRs, making the key accessible to local programs regardless
813 of the current PCR state.</para>
814
815 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
816 </varlistentry>
817
818 <varlistentry>
819 <term><option>tpm2-pin=</option></term>
820
821 <listitem><para>Takes a boolean argument, defaults to <literal>false</literal>. Controls whether
822 TPM2 volume unlocking is bound to a PIN in addition to PCRs. Similarly, this option is only useful
823 when TPM2 enrollment metadata is not available.</para>
824
825 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
826 </varlistentry>
827
828 <varlistentry>
829 <term><option>tpm2-signature=</option></term>
830
831 <listitem><para>Takes an absolute path to a TPM2 PCR JSON signature file, as produced by the
832 <citerefentry><refentrytitle>systemd-measure</refentrytitle><manvolnum>1</manvolnum></citerefentry>
833 tool. This permits locking LUKS2 volumes to any PCR values for which a valid signature matching a
834 public key specified at key enrollment time can be provided. See
835 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
836 for details on enrolling TPM2 PCR public keys. If this option is not specified but it is attempted to
837 unlock a LUKS2 volume with a signed TPM2 PCR enrollment a suitable signature file
838 <filename>tpm2-pcr-signature.json</filename> is searched for in <filename>/etc/systemd/</filename>,
839 <filename>/run/systemd/</filename>, <filename>/usr/lib/systemd/</filename> (in this
840 order).</para>
841
842 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
843 </varlistentry>
844
845 <varlistentry>
846 <term><option>tpm2-pcrlock=</option></term>
847
848 <listitem><para>Takes an absolute path to a TPM2 pcrlock policy file, as produced by the
849 <citerefentry><refentrytitle>systemd-pcrlock</refentrytitle><manvolnum>1</manvolnum></citerefentry>
850 tool. This permits locking LUKS2 volumes to a local policy of allowed PCR values with
851 variants. See
852 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
853 for details on enrolling TPM2 pcrlock policies. If this option is not specified but it is attempted
854 to unlock a LUKS2 volume with a TPM2 pcrlock enrollment a suitable signature file
855 <filename>pcrlock.json</filename> is searched for in <filename>/run/systemd/</filename> and
856 <filename>/var/lib/systemd/</filename> (in this order).</para>
857
858 <xi:include href="version-info.xml" xpointer="v255"/></listitem>
859 </varlistentry>
860
861 <varlistentry>
862 <term><option>tpm2-measure-pcr=</option></term>
863
864 <listitem><para>Controls whether to measure the volume key of the encrypted volume to a TPM2 PCR. If
865 set to "no" (which is the default) no PCR extension is done. If set to "yes" the volume key is
866 measured into PCR 15. If set to a decimal integer in the range 023 the volume key is measured into
867 the specified PCR. The volume key is measured along with the activated volume name and its UUID. This
868 functionality is particularly useful for the encrypted volume backing the root file system, as it
869 then allows later TPM objects to be securely bound to the root file system and hence the specific
870 installation.</para>
871
872 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
873 </varlistentry>
874
875 <varlistentry>
876 <term><option>tpm2-measure-bank=</option></term>
877
878 <listitem><para>Selects one or more TPM2 PCR banks to measure the volume key into, as configured with
879 <option>tpm2-measure-pcr=</option> above. Multiple banks may be specified, separated by a colon
880 character. If not specified automatically determines available and used banks. Expects a message
881 digest name (e.g. <literal>sha1</literal>, <literal>sha256</literal>, …) as argument, to identify the
882 bank.</para>
883
884 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
885 </varlistentry>
886
887 <varlistentry>
888 <term><option>token-timeout=</option></term>
889
890 <listitem><para>Specifies how long to wait at most for configured security devices (i.e. FIDO2,
891 PKCS#11, TPM2) to show up. Takes a time value in seconds (but other time units may be specified too,
892 see <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
893 for supported formats). Defaults to 30s. Once the specified timeout elapsed authentication via
894 password is attempted. Note that this timeout applies to waiting for the security device to show up —
895 it does not apply to the PIN prompt for the device (should one be needed) or similar. Pass 0 to turn
896 off the time-out and wait forever.</para>
897
898 <xi:include href="version-info.xml" xpointer="v250"/></listitem>
899 </varlistentry>
900
901 <varlistentry>
902 <term><option>try-empty-password=</option></term>
903
904 <listitem><para>Takes a boolean argument. If enabled, right before asking the user for a password it
905 is first attempted to unlock the volume with an empty password. This is useful for systems that are
906 initialized with an encrypted volume with only an empty password set, which shall be replaced with a
907 suitable password during first boot, but after activation.</para>
908
909 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
910 </varlistentry>
911
912 <varlistentry>
913 <term><option>x-systemd.device-timeout=</option></term>
914
915 <listitem><para>Specifies how long systemd should wait for a block device to show up before
916 giving up on the entry. The argument is a time in seconds or explicitly specified units of
917 <literal>s</literal>, <literal>min</literal>, <literal>h</literal>, <literal>ms</literal>.
918 </para>
919
920 <xi:include href="version-info.xml" xpointer="v216"/></listitem>
921 </varlistentry>
922
923 <varlistentry>
924 <term><option>x-initrd.attach</option></term>
925
926 <listitem><para>Setup this encrypted block device in the initrd, similarly to
927 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
928 units marked with <option>x-initrd.mount</option>.</para>
929
930 <para>Although it's not necessary to mark the mount entry for the root file system with
931 <option>x-initrd.mount</option>, <option>x-initrd.attach</option> is still recommended with
932 the encrypted block device containing the root file system as otherwise systemd will
933 attempt to detach the device during the regular system shutdown while it's still in
934 use. With this option the device will still be detached but later after the root file
935 system is unmounted.</para>
936
937 <para>All other encrypted block devices that contain file systems mounted in the initrd should use
938 this option.</para>
939
940 <xi:include href="version-info.xml" xpointer="v245"/>
941 </listitem>
942 </varlistentry>
943
944 </variablelist>
945
946 <para>At early boot and when the system manager configuration is
947 reloaded, this file is translated into native systemd units by
948 <citerefentry><refentrytitle>systemd-cryptsetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
949 </refsect1>
950
951 <refsect1>
952 <title><constant>AF_UNIX</constant> Key Files</title>
953
954 <para>If the key file path (as specified in the third column of <filename>/etc/crypttab</filename>
955 entries, see above) refers to an <constant>AF_UNIX</constant> stream socket in the file system, the key
956 is acquired by connecting to the socket and reading the key from the connection. The connection is made
957 from an <constant>AF_UNIX</constant> socket name in the abstract namespace, see <citerefentry
958 project='man-pages'><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
959 details. The source socket name is chosen according to the following format:</para>
960
961 <programlisting><constant>NUL</constant> <replaceable>RANDOM</replaceable> /cryptsetup/ <replaceable>VOLUME</replaceable></programlisting>
962
963 <para>In other words: a <constant>NUL</constant> byte (as required for abstract namespace sockets),
964 followed by a random string (consisting of alphanumeric characters only), followed by the literal
965 string <literal>/cryptsetup/</literal>, followed by the name of the volume to acquire they key
966 for. For example, for the volume <literal>myvol</literal>:</para>
967
968 <programlisting>\0d7067f78d9827418/cryptsetup/myvol</programlisting>
969
970 <para>Services listening on the <constant>AF_UNIX</constant> stream socket may query the source socket
971 name with <citerefentry
972 project='man-pages'><refentrytitle>getpeername</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
973 and use this to determine which key to send, allowing a single listening socket to serve keys for
974 multiple volumes. If the PKCS#11 logic is used (see above), the socket source name is picked in similar
975 fashion, except that the literal string <literal>/cryptsetup-pkcs11/</literal> is used. And similarly for
976 FIDO2 (<literal>/cryptsetup-fido2/</literal>) and TPM2 (<literal>/cryptsetup-tpm2/</literal>). A different
977 path component is used so that services providing key material know that the secret key was not requested
978 directly, but instead an encrypted key that will be decrypted via the PKCS#11/FIDO2/TPM2 logic to acquire
979 the final secret key.</para>
980 </refsect1>
981
982 <refsect1>
983 <title>Examples</title>
984 <example>
985 <title>/etc/crypttab example</title>
986 <para>Set up four encrypted block devices. One using LUKS for normal storage, another one for usage as
987 a swap device and two TrueCrypt volumes. For the fourth device, the option string is interpreted as two
988 options <literal>cipher=xchacha12,aes-adiantum-plain64</literal>,
989 <literal>keyfile-timeout=10s</literal>.</para>
990
991 <programlisting>luks UUID=2505567a-9e27-4efe-a4d5-15ad146c258b
992 swap /dev/sda7 /dev/urandom swap
993 truecrypt /dev/sda2 /etc/container_password tcrypt
994 hidden /mnt/tc_hidden /dev/null tcrypt-hidden,tcrypt-keyfile=/etc/keyfile
995 external /dev/sda3 keyfile:LABEL=keydev keyfile-timeout=10s,cipher=xchacha12\,aes-adiantum-plain64
996 </programlisting>
997 </example>
998
999 <example>
1000 <title>Yubikey-based PKCS#11 Volume Unlocking Example</title>
1001
1002 <para>The PKCS#11 logic allows hooking up any compatible security token that is capable of storing RSA
1003 or EC cryptographic keys for unlocking an encrypted volume. Here's an example how to set up a Yubikey
1004 security token for this purpose on a LUKS2 volume, using <citerefentry
1005 project='debian'><refentrytitle>ykmap</refentrytitle><manvolnum>1</manvolnum></citerefentry> from the
1006 yubikey-manager project to initialize the token and
1007 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1008 to add it in the LUKS2 volume:</para>
1009
1010 <programlisting><xi:include href="yubikey-crypttab.sh" parse="text" /></programlisting>
1011
1012 <para>A few notes on the above:</para>
1013
1014 <itemizedlist>
1015 <listitem><para>We use RSA2048, which is the longest key size current Yubikeys support</para></listitem>
1016 <listitem><para>We use Yubikey key slot 9d, since that's apparently the keyslot to use for decryption purposes,
1017 see
1018 <ulink url="https://developers.yubico.com/PIV/Introduction/Certificate_slots.html">Yubico PIV certificate slots</ulink>.
1019 </para></listitem>
1020 </itemizedlist>
1021 </example>
1022
1023 <example>
1024 <title>FIDO2 Volume Unlocking Example</title>
1025
1026 <para>The FIDO2 logic allows using any compatible FIDO2 security token that implements the
1027 <literal>hmac-secret</literal> extension for unlocking an encrypted volume. Here's an example how to
1028 set up a FIDO2 security token for this purpose for a LUKS2 volume, using
1029 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>:</para>
1030
1031 <programlisting><xi:include href="fido2-crypttab.sh" parse="text" /></programlisting>
1032 </example>
1033
1034 <example>
1035 <title>TPM2 Volume Unlocking Example</title>
1036
1037 <para>The TPM2 logic allows using any TPM2 chip supported by the Linux kernel for unlocking an
1038 encrypted volume. Here's an example how to set up a TPM2 chip for this purpose for a LUKS2 volume,
1039 using
1040 <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry>:</para>
1041
1042 <programlisting><xi:include href="tpm2-crypttab.sh" parse="text" /></programlisting>
1043 </example>
1044 </refsect1>
1045
1046 <refsect1>
1047 <title>See Also</title>
1048 <para><simplelist type="inline">
1049 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1050 <member><citerefentry><refentrytitle>systemd-cryptsetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1051 <member><citerefentry><refentrytitle>systemd-cryptsetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1052 <member><citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
1053 <member><citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
1054 <member><citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1055 <member><citerefentry project='man-pages'><refentrytitle>mkswap</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1056 <member><citerefentry project='man-pages'><refentrytitle>mke2fs</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
1057 </simplelist></para>
1058 </refsect1>
1059
1060 </refentry>