1CRYPTTAB(5)                        crypttab                        CRYPTTAB(5)
2
3
4

NAME

6       crypttab - Configuration for encrypted block devices
7

SYNOPSIS

9       /etc/crypttab
10

DESCRIPTION

12       The /etc/crypttab file describes encrypted block devices that are set
13       up during system boot.
14
15       Empty lines and lines starting with the "#" character are ignored. Each
16       of the remaining lines describes one encrypted block device. Fields are
17       delimited by white space.
18
19       Each line is in the form
20
21           name encrypted-device password options
22
23       The first two fields are mandatory, the remaining two are optional.
24
25       Setting up encrypted block devices using this file supports three
26       encryption modes: LUKS, TrueCrypt and plain. See cryptsetup(8) for more
27       information about each mode. When no mode is specified in the options
28       field and the block device contains a LUKS signature, it is opened as a
29       LUKS device; otherwise, it is assumed to be in raw dm-crypt (plain
30       mode) format.
31
32       The first field contains the name of the resulting encrypted block
33       device; the device is set up within /dev/mapper/.
34
35       The second field contains a path to the underlying block device or
36       file, or a specification of a block device via "UUID=" followed by the
37       UUID.
38
39       The third field specifies the encryption password. If the field is not
40       present or the password is set to "none" or "-", the password has to be
41       manually entered during system boot. Otherwise, the field is
42       interpreted as an absolute path to a file containing the encryption
43       password. For swap encryption, /dev/urandom or the hardware device
44       /dev/hw_random can be used as the password file; using /dev/random may
45       prevent boot completion if the system does not have enough entropy to
46       generate a truly random encryption key.
47
48       The fourth field, if present, is a comma-delimited list of options. The
49       following options are recognized:
50
51       cipher=
52           Specifies the cipher to use. See cryptsetup(8) for possible values
53           and the default value of this option. A cipher with unpredictable
54           IV values, such as "aes-cbc-essiv:sha256", is recommended.
55
56       discard
57           Allow discard requests to be passed through the encrypted block
58           device. This improves performance on SSD storage but has security
59           implications.
60
61       hash=
62           Specifies the hash to use for password hashing. See cryptsetup(8)
63           for possible values and the default value of this option.
64
65       header=
66           Use a detached (separated) metadata device or file where the LUKS
67           header is stored. This option is only relevant for LUKS devices.
68           See cryptsetup(8) for possible values and the default value of this
69           option.
70
71       keyfile-offset=
72           Specifies the number of bytes to skip at the start of the key file.
73           See cryptsetup(8) for possible values and the default value of this
74           option.
75
76       keyfile-size=
77           Specifies the maximum number of bytes to read from the key file.
78           See cryptsetup(8) for possible values and the default value of this
79           option. This option is ignored in plain encryption mode, as the key
80           file size is then given by the key size.
81
82       key-slot=
83           Specifies the key slot to compare the passphrase or key against. If
84           the key slot does not match the given passphrase or key, but
85           another would, the setup of the device will fail regardless. This
86           option implies luks. See cryptsetup(8) for possible values. The
87           default is to try all key slots in sequential order.
88
89       luks
90           Force LUKS mode. When this mode is used, the following options are
91           ignored since they are provided by the LUKS header on the device:
92           cipher=, hash=, size=.
93
94       _netdev
95           Marks this cryptsetup device as requiring network. It will be
96           started after the network is available, similarly to
97           systemd.mount(5) units marked with _netdev. The service unit to set
98           up this device will be ordered between remote-fs-pre.target and
99           remote-cryptsetup.target, instead of cryptsetup-pre.target and
100           cryptsetup.target.
101
102           Hint: if this device is used for a mount point that is specified in
103           fstab(5), the _netdev option should also be used for the mount
104           point. Otherwise, a dependency loop might be created where the
105           mount point will be pulled in by local-fs.target, while the service
106           to configure the network is usually only started after the local
107           file system has been mounted.
108
109       noauto
110           This device will not be added to cryptsetup.target. This means that
111           it will not be automatically unlocked on boot, unless something
112           else pulls it in. In particular, if the device is used for a mount
113           point, it'll be unlocked automatically during boot, unless the
114           mount point itself is also disabled with noauto.
115
116       nofail
117           This device will not be a hard dependency of cryptsetup.target.
118           It'll be still pulled in and started, but the system will not wait
119           for the device to show up and be unlocked, and boot will not fail
120           if this is unsuccessful. Note that other units that depend on the
121           unlocked device may still fail. In particular, if the device is
122           used for a mount point, the mount point itself is also needs to
123           have noauto option, or the boot will fail if the device is not
124           unlocked successfully.
125
126       offset=
127           Start offset in the backend device, in 512-byte sectors. This
128           option is only relevant for plain devices.
129
130       plain
131           Force plain encryption mode.
132
133       read-only, readonly
134           Set up the encrypted block device in read-only mode.
135
136       skip=
137           How many 512-byte sectors of the encrypted data to skip at the
138           beginning. This is different from the offset= option with respect
139           to the sector numbers used in initialization vector (IV)
140           calculation. Using offset= will shift the IV calculation by the
141           same negative amount. Hence, if offset=n is given, sector n will
142           get a sector number of 0 for the IV calculation. Using skip= causes
143           sector n to also be the first sector of the mapped device, but with
144           its number for IV generation being n.
145
146           This option is only relevant for plain devices.
147
148       size=
149           Specifies the key size in bits. See cryptsetup(8) for possible
150           values and the default value of this option.
151
152       sector-size=
153           Specifies the sector size in bytes. See cryptsetup(8) for possible
154           values and the default value of this option.
155
156       swap
157           The encrypted block device will be used as a swap device, and will
158           be formatted accordingly after setting up the encrypted block
159           device, with mkswap(8). This option implies plain.
160
161           WARNING: Using the swap option will destroy the contents of the
162           named partition during every boot, so make sure the underlying
163           block device is specified correctly.
164
165       tcrypt
166           Use TrueCrypt encryption mode. When this mode is used, the
167           following options are ignored since they are provided by the
168           TrueCrypt header on the device or do not apply: cipher=, hash=,
169           keyfile-offset=, keyfile-size=, size=.
170
171           When this mode is used, the passphrase is read from the key file
172           given in the third field. Only the first line of this file is read,
173           excluding the new line character.
174
175           Note that the TrueCrypt format uses both passphrase and key files
176           to derive a password for the volume. Therefore, the passphrase and
177           all key files need to be provided. Use tcrypt-keyfile= to provide
178           the absolute path to all key files. When using an empty passphrase
179           in combination with one or more key files, use "/dev/null" as the
180           password file in the third field.
181
182       tcrypt-hidden
183           Use the hidden TrueCrypt volume. This option implies tcrypt.
184
185           This will map the hidden volume that is inside of the volume
186           provided in the second field. Please note that there is no
187           protection for the hidden volume if the outer volume is mounted
188           instead. See cryptsetup(8) for more information on this limitation.
189
190       tcrypt-keyfile=
191           Specifies the absolute path to a key file to use for a TrueCrypt
192           volume. This implies tcrypt and can be used more than once to
193           provide several key files.
194
195           See the entry for tcrypt on the behavior of the passphrase and key
196           files when using TrueCrypt encryption mode.
197
198       tcrypt-system
199           Use TrueCrypt in system encryption mode. This option implies
200           tcrypt.
201
202       tcrypt-veracrypt
203           Check for a VeraCrypt volume. VeraCrypt is a fork of TrueCrypt that
204           is mostly compatible, but uses different, stronger key derivation
205           algorithms that cannot be detected without this flag. Enabling this
206           option could substantially slow down unlocking, because VeraCrypt's
207           key derivation takes much longer than TrueCrypt's. This option
208           implies tcrypt.
209
210       timeout=
211           Specifies the timeout for querying for a password. If no unit is
212           specified, seconds is used. Supported units are s, ms, us, min, h,
213           d. A timeout of 0 waits indefinitely (which is the default).
214
215       tmp
216           The encrypted block device will be prepared for using it as /tmp;
217           it will be formatted using mke2fs(8). This option implies plain.
218
219           WARNING: Using the tmp option will destroy the contents of the
220           named partition during every boot, so make sure the underlying
221           block device is specified correctly.
222
223       tries=
224           Specifies the maximum number of times the user is queried for a
225           password. The default is 3. If set to 0, the user is queried for a
226           password indefinitely.
227
228       verify
229           If the encryption password is read from console, it has to be
230           entered twice to prevent typos.
231
232       x-systemd.device-timeout=
233           Specifies how long systemd should wait for a device to show up
234           before giving up on the entry. The argument is a time in seconds or
235           explicitly specified units of "s", "min", "h", "ms".
236
237       At early boot and when the system manager configuration is reloaded,
238       this file is translated into native systemd units by systemd-
239       cryptsetup-generator(8).
240

EXAMPLE

242       Example 1. /etc/crypttab example
243
244       Set up four encrypted block devices. One using LUKS for normal storage,
245       another one for usage as a swap device and two TrueCrypt volumes.
246
247           luks       UUID=2505567a-9e27-4efe-a4d5-15ad146c258b
248           swap       /dev/sda7       /dev/urandom       swap
249           truecrypt  /dev/sda2       /etc/container_password  tcrypt
250           hidden     /mnt/tc_hidden  /dev/null    tcrypt-hidden,tcrypt-keyfile=/etc/keyfile
251

SEE ALSO

253       systemd(1), systemd-cryptsetup@.service(8), systemd-cryptsetup-
254       generator(8), fstab(5), cryptsetup(8), mkswap(8), mke2fs(8)
255
256
257
258systemd 241                                                        CRYPTTAB(5)
Impressum