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       swap
153           The encrypted block device will be used as a swap device, and will
154           be formatted accordingly after setting up the encrypted block
155           device, with mkswap(8). This option implies plain.
156
157           WARNING: Using the swap option will destroy the contents of the
158           named partition during every boot, so make sure the underlying
159           block device is specified correctly.
160
161       tcrypt
162           Use TrueCrypt encryption mode. When this mode is used, the
163           following options are ignored since they are provided by the
164           TrueCrypt header on the device or do not apply: cipher=, hash=,
165           keyfile-offset=, keyfile-size=, size=.
166
167           When this mode is used, the passphrase is read from the key file
168           given in the third field. Only the first line of this file is read,
169           excluding the new line character.
170
171           Note that the TrueCrypt format uses both passphrase and key files
172           to derive a password for the volume. Therefore, the passphrase and
173           all key files need to be provided. Use tcrypt-keyfile= to provide
174           the absolute path to all key files. When using an empty passphrase
175           in combination with one or more key files, use "/dev/null" as the
176           password file in the third field.
177
178       tcrypt-hidden
179           Use the hidden TrueCrypt volume. This option implies tcrypt.
180
181           This will map the hidden volume that is inside of the volume
182           provided in the second field. Please note that there is no
183           protection for the hidden volume if the outer volume is mounted
184           instead. See cryptsetup(8) for more information on this limitation.
185
186       tcrypt-keyfile=
187           Specifies the absolute path to a key file to use for a TrueCrypt
188           volume. This implies tcrypt and can be used more than once to
189           provide several key files.
190
191           See the entry for tcrypt on the behavior of the passphrase and key
192           files when using TrueCrypt encryption mode.
193
194       tcrypt-system
195           Use TrueCrypt in system encryption mode. This option implies
196           tcrypt.
197
198       tcrypt-veracrypt
199           Check for a VeraCrypt volume. VeraCrypt is a fork of TrueCrypt that
200           is mostly compatible, but uses different, stronger key derivation
201           algorithms that cannot be detected without this flag. Enabling this
202           option could substantially slow down unlocking, because VeraCrypt's
203           key derivation takes much longer than TrueCrypt's. This option
204           implies tcrypt.
205
206       timeout=
207           Specifies the timeout for querying for a password. If no unit is
208           specified, seconds is used. Supported units are s, ms, us, min, h,
209           d. A timeout of 0 waits indefinitely (which is the default).
210
211       tmp
212           The encrypted block device will be prepared for using it as /tmp;
213           it will be formatted using mke2fs(8). This option implies plain.
214
215           WARNING: Using the tmp option will destroy the contents of the
216           named partition during every boot, so make sure the underlying
217           block device is specified correctly.
218
219       tries=
220           Specifies the maximum number of times the user is queried for a
221           password. The default is 3. If set to 0, the user is queried for a
222           password indefinitely.
223
224       verify
225           If the encryption password is read from console, it has to be
226           entered twice to prevent typos.
227
228       x-systemd.device-timeout=
229           Specifies how long systemd should wait for a device to show up
230           before giving up on the entry. The argument is a time in seconds or
231           explicitly specified units of "s", "min", "h", "ms".
232
233       At early boot and when the system manager configuration is reloaded,
234       this file is translated into native systemd units by systemd-
235       cryptsetup-generator(8).
236

EXAMPLE

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

SEE ALSO

249       systemd(1), systemd-cryptsetup@.service(8), systemd-cryptsetup-
250       generator(8), fstab(5), cryptsetup(8), mkswap(8), mke2fs(8)
251
252
253
254systemd 239                                                        CRYPTTAB(5)
Impressum