'\" t .\" Title: crypttab .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 2017-05-09 .\" Manual: cryptsetup manual .\" Source: cryptsetup 2:1.7.3-4 .\" Language: English .\" .TH "CRYPTTAB" "5" "2017\-05\-09" "cryptsetup 2:1\&.7\&.3\-4" "cryptsetup manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" crypttab \- static information about encrypted filesystems .SH "DESCRIPTION" .sp The file /etc/crypttab contains descriptive information about encrypted filesystems\&. crypttab is only read by programs (e\&.g\&. \fBcryptdisks_start\fR and \fBcryptdisks_stop\fR), and not written; it is the duty of the system administrator to properly create and maintain this file\&. Each filesystem is described on a separate line; fields on each line are separated by tabs or spaces\&. Lines starting with \(lq#\(rq are comments, empty lines are ignored\&. The order of records in crypttab is important because the init scripts sequentially iterate through crypttab doing their thing\&. .sp The first field, \fItarget\fR, describes the mapped device name\&. It must be a plain filename without any directory components\&. A mapped device which encrypts/decrypts data to/from the \fIsource device\fR will be created at /dev/mapper/target by \fBcryptsetup\fR\&. .sp The second field, \fIsource device\fR, describes either the block special device or file that contains the encrypted data\&. Instead of giving the \fIsource device\fR explicitly, the UUID is supported as well, using \fIUUID=\fR\&. .sp The third field, \fIkey file\fR, describes the file to use as a key for decrypting the data of the \fIsource device\fR\&. Note that the \fIentire\fR key file will be used as the passphrase; the passphrase must \fInot\fR be followed by a newline character\&. .sp It can also be a device name (e\&.g\&. /dev/urandom), note however that LUKS requires a persistent key and therefore does \fInot\fR support random data keys\&. .sp If the \fIkey file\fR is the string \(lqnone\(rq, a passphrase will be read interactively from the console\&. In this case, the options precheck, check, checkargs and tries may be useful\&. .sp The fourth field, \fIoptions\fR, describes the cryptsetup options associated with the encryption process\&. At minimum, the field should contain either the string \fIluks\fR respectively \fItcrypt\fR or the \fIcipher\fR, \fIhash\fR and \fIsize\fR options\&. .sp Options are in the format: \fIkey\fR=\fIvalue\fR [,\fIkey\fR=\fIvalue\fR \&...]\&. The supported options are described below\&. .sp Note that all four fields are mandatory and that a missing field will lead to unspecified behaviour\&. .SH "OPTIONS" .PP \fIcipher\fR= .RS 4 Encryption algorithm (ignored for LUKS and TCRYPT devices)\&. See \fBcryptsetup \-c\fR\&. .RE .PP \fIsize\fR= .RS 4 Encryption key size (ignored for LUKS and TCRYPT devices)\&. See \fBcryptsetup \-s\fR\&. .RE .PP \fIhash\fR= .RS 4 Hash algorithm (ignored for LUKS and TCRYPT devices)\&. See \fBcryptsetup \-h\fR\&. .RE .PP \fIoffset\fR= .RS 4 Start offset (ignored for LUKS and TCRYPT devices)\&. Uses \fBcryptsetup \-o\fR\&. .RE .PP \fIskip\fR= .RS 4 Skip sectors at the beginning (ignored for LUKS and TCRYPT devices)\&. Uses \fBcryptsetup \-p\fR\&. .RE .PP \fIverify\fR .RS 4 Verify password\&. Uses \fBcryptsetup \-y\fR\&. .RE .PP \fIreadonly\fR .RS 4 The backing device is read\-only (eg: a dvd)\&. .RE .PP \fIdiscard\fR .RS 4 Allow using of discards (TRIM) requests for device\&. .sp \fBWARNING\fR: Assess the specific security risks carefully before enabling this option\&. For example, allowing discards on encrypted devices may lead to the leak of information about the ciphertext device (filesystem type, used space etc\&.) if the discarded blocks can be located easily on the device later\&. .sp Kernel version 3\&.1 or more recent is required\&. For older versions is the option ignored\&. .RE .PP \fIluks\fR .RS 4 Use device with LUKS extensions\&. .RE .PP \fItcrypt\fR .RS 4 Use device with TCRYPT extensions\&. .RE .PP \fIveracrypt\fR .RS 4 Use VeraCrypt extension to TCRYPT device\&. Only useful in conjunction with \fItcrypt\fR option (ignored for non\-TCRYPT devices)\&. .RE .PP \fIswap\fR .RS 4 Run \fBmkswap\fR on the created device\&. .RE .PP \fItmp\fR= .RS 4 Run \fBmkfs\fR with filesystem type on the created device\&. Default is ext4\&. .RE .PP \fIprecheck\fR= .RS 4 Check the content of the source device by a suitable program; if the check fails, the device is not created\&. If a program is provided as an argument, it is run, giving the source device as argument\&. Cryptdisks/cryptroot searches for the given progam in /lib/cryptsetup/checks/ first, but full path to program is supported as well\&. .sp Prechecks aren\*(Aqt invoked for LUKS devices, as these are checked with isLuks anyway\&. Default for plain dm\-crypt devices is set in /etc/default/cryptdisks, or un_blkid otherwise\&. Set to /bin/true in order to disable precheck for plain dm\-crypt device\&. .RE .PP \fIcheck\fR= .RS 4 Check the content of the target device by a suitable program; if the check fails, the device is removed\&. If a program is provided as an argument, it is run, giving the decrypted volume (target device) as first argument, and the value of the checkargs option as second argument\&. Cryptdisks/cryptroot searches for the given program in /lib/cryptsetup/checks/ first, but full path to program is supported as well\&. .sp Default is set in /etc/default/cryptdisks (blkid)\&. .RE .PP \fIcheckargs\fR= .RS 4 Give as the second argument to the check script\&. See the CHECKSCRIPTS section for more information\&. .RE .PP \fItries\fR= .RS 4 The input of the passphrase is tried times in case of failure\&. If you want to disable retries, pass \(lqtries=1\(rq\&. Default is 3\&. Setting \(lqtries=0\(rq will ask for the passphrase until a correct one has been submitted (infinitive retries)\&. .RE .PP \fIinitramfs\fR .RS 4 The initramfs hook processes the root device, any resume devices and any devices with the \(lqinitramfs\(rq option set\&. These devices are processed within the initramfs stage of boot\&. As an example, that allows the use of remote unlocking using dropbear\&. .RE .PP \fInoearly\fR .RS 4 The cryptsetup init scripts are invoked twice during the boot process \- once before lvm, raid, etc\&. are started and once again after that\&. Sometimes you need to start your encrypted disks in a special order\&. With this option the device is ignored during the first invocation of the cryptsetup init scripts\&. .RE .PP \fInoauto\fR .RS 4 Entirely ignore the device at the boot process\&. It\*(Aqs still possible to map the device manually using cryptdisks_start\&. .RE .PP \fIloud\fR .RS 4 Be loud\&. Print warnings if a device does not exist\&. This option overwrites the option \fIquiet\fR\&. .RE .PP \fIquiet\fR .RS 4 Be quiet\&. Don\*(Aqt print warnings if a device does not exist\&. This option overwrites the option \fIloud\fR\&. .RE .PP \fIkeyscript\fR= .RS 4 The executable at the indicated path is executed with the \fIkey file\fR from the third field of the crypttab as its only argument and the output is used as the key\&. This also works with encrypted root filesystems via initramfs if the executable is self\-contained (i\&.e\&. an executable which does not rely on any external program which is not present in the initramfs environment)\&. .sp LIMITATIONS: All binaries and files on which the keyscript depends must be available at the time of execution\&. Special care needs to be taken for encrypted filesystems like /usr or /var\&. As an example, unlocking encrypted /usr must not depend on binaries from /usr/(s)bin\&. .sp WARNING: With systemd as init system, this option might be ignored\&. At the time this is written (December 2016), the systemd cryptsetup helper doesn\*(Aqt support the keyscript option to /etc/crypttab\&. For the time being, the only option to use keyscripts along with systemd is to force processing of the corresponding crypto devices in the initramfs\&. See the \*(Aqinitramfs\*(Aq option for further information\&. .sp All fields of the appropriate crypttab entry are available to the keyscript as exported environment variables: .PP CRYPTTAB_NAME .RS 4 The target name .RE .PP CRYPTTAB_SOURCE .RS 4 The source device .RE .PP CRYPTTAB_KEY .RS 4 The key file .RE .PP CRYPTTAB_TRIED .RS 4 Number of previous tries since start of cryptdisks (counts until maximum number of tries is reached)\&. .RE .PP CRYPTTAB_OPTIONS .RS 4 A list of exported crypttab options .RE .PP CRYPTTAB_OPTION_