1
.TH CRYPTSETUP "8" "March 2005" "cryptsetup" "Maintenance Commands"
1
.TH CRYPTSETUP "8" "" "cryptsetup" "Maintenance Commands"
3
3
cryptsetup - setup cryptographic volumes for dm-crypt (including LUKS extension)
6
6
.B cryptsetup <options> <action> <action args>
9
.\" Add any additional description here
11
cryptsetup is used to conveniently setup dm-crypt managed device-mapper mappings. For basic dm-crypt mappings, there are five operations.
9
cryptsetup is used to conveniently setup dm-crypt managed device-mapper mappings.
10
For basic (plain) dm-crypt mappings, there are four operations.
13
12
These strings are valid for \fB<action>\fR, followed by their \fB<action args>\fR:
15
14
\fIcreate\fR <name> <device>
17
16
creates a mapping with <name> backed by device <device>.
18
<options> can be [\-\-hash, \-\-cipher, \-\-verify-passphrase, \-\-key-file, \-\-key-size, \-\-offset, \-\-skip, \-\-readonly]
18
\fB<options>\fR can be [\-\-hash, \-\-cipher, \-\-verify-passphrase, \-\-key-file, \-\-key-size, \-\-offset, \-\-skip, \-\-readonly]
20
20
\fIremove\fR <name>
22
removes an existing mapping <name>. No options.
22
removes an existing mapping <name>.
24
24
\fIstatus\fR <name>
26
reports the status for the mapping <name>. No options.
26
reports the status for the mapping <name>.
28
28
\fIresize\fR <name>
41
41
\fIluksFormat\fR <device> [<key file>]
43
43
initializes a LUKS partition and sets the initial key, either via prompting or via <key file>.
44
<options> can be [\-\-cipher, \-\-verify-passphrase, \-\-key-size, \-\-key-slot].
45
\fB<options>\fR can be [\-\-cipher, \-\-verify-passphrase, \-\-key-size, \-\-key-slot,
46
\-\-key-file (takes precedence over optional second argument)].
46
49
\fIluksOpen\fR <device> <name>
48
51
opens the LUKS partition <device> and sets up a mapping <name> after successful verification of the supplied key material (either via key file by \-\-key-file, or via prompting).
49
<options> can be [\-\-key-file, \-\-readonly].
53
\fB<options>\fR can be [\-\-key-file, \-\-readonly].
51
55
\fIluksClose\fR <name>
63
67
\fIluksResume\fR <name>
65
Resumes suspended device and reinstates encryption key. You will need provide passphrase identical to \fIluksOpen\fR command (using prompting or key file).
69
Resumes suspended device and reinstates encryption key. You will need provide passphrase
70
identical to \fIluksOpen\fR command (using prompting or key file).
72
\fB<options>\fR can be [\-\-key-file]
67
74
\fIluksAddKey\fR <device> [<new key file>]
69
add a new key file/passphrase. An existing passphrase or key file (via \-\-key-file) must be supplied. The key file with the new material is supplied as a positional argument. <options> can be [\-\-key-file, \-\-key-slot].
76
add a new key file/passphrase. An existing passphrase or key file (via \-\-key-file) must be supplied.
77
The key file with the new material is supplied as a positional argument.
79
\fB<options>\fR can be [\-\-key-file, \-\-key-slot].
71
81
\fIluksRemoveKey\fR <device> [<key file>]
75
85
\fIluksKillSlot\fR <device> <key slot number>
77
wipe key with number <key slot> from LUKS device. A remaining passphrase or key file (via \-\-key-file) must be supplied. <options> can be [\-\-key-file].
87
wipe key with number <key slot> from LUKS device. A remaining passphrase or
88
key file (via \-\-key-file) must be supplied.
90
\fB<options>\fR can be [\-\-key-file].
79
92
\fIluksDelKey\fR <device> <key slot number>
83
96
\fIluksUUID\fR <device>
85
print UUID, if <device> has a LUKS header. No options.
98
print UUID, if <device> has a LUKS header.
87
100
\fIisLuks\fR <device>
89
returns true, if <device> is a LUKS partition. Otherwise, false. No options.
102
returns true, if <device> is a LUKS partition. Otherwise, false.
91
104
\fIluksDump\fR <device>
93
dumps the header information of a LUKS partition. No options.
106
dumps the header information of a LUKS partition.
95
\fIluksHeaderBackup\fR <device> --header-backup-file <file>
108
\fIluksHeaderBackup\fR <device> \-\-header-backup-file <file>
97
110
Stores binary backup of LUKS header and keyslot areas.
122
141
\fBWARNING:\fR setting hash other than \fBsha1\fR causes LUKS device incompatible with older version of cryptsetup.
124
143
The hash string is passed to libgcrypt, so all hashes accepted by gcrypt are supported.
125
Default is \fB"ripemd160"\fR for \fIcreate\fR action and \fB"sha1"\fR for \fIluksFormat\fR.
144
Default is set during compilation, compatible values with old version of cryptsetup are
145
\fB"ripemd160"\fR for \fIcreate\fR action and \fB"sha1"\fR for \fIluksFormat\fR.
147
Use \fIcryptsetup \-\-help\fR to show defaults.
127
149
.B "\-\-cipher, \-c"
128
set cipher specification string. For plain dm-crypt mappings, the default is "aes-cbc-plain", for LUKS mappings it's "aes-cbc-essiv:sha256". For pre-2.6.10 kernels, use "aes-plain" as they don't understand the new cipher spec strings. To use ESSIV, use "aes-cbc-essiv:sha256".
130
For XTS mode, kernel version 2.6.24 or more recent is required. Use "aes-xts-plain" cipher specification and set key size to 256 (or 512) bits (see \-s option).
150
set cipher specification string.
152
Default mode is configurable during compilation,
153
you can see compiled-in default using \fIcryptsetup \-\-help\fR.
154
If not changed, the default is for plain dm-crypt and LUKS mappings
155
"aes-cbc-essiv:sha256".
157
For pre-2.6.10 kernels, use "aes-plain" as they don't understand
158
the new cipher spec strings. To use ESSIV, use "aes-cbc-essiv:sha256".
160
For XTS mode, kernel version 2.6.24 or more recent is required.
161
Use "aes-xts-plain" cipher specification and set key size to 256 (or 512) bits (see \-s option).
132
163
.B "\-\-verify-passphrase, \-y"
133
164
query for passwords twice. Useful when creating a (regular) mapping for the first time, or when running \fIluksFormat\fR.
135
166
.B "\-\-key-file, \-d"
136
use file as key material. With LUKS, key material supplied in key files via \-d are always used for existing passphrases. If you want to set a new key via a key file, you have to use a positional arg to \fIluksFormat\fR or \fIluksAddKey\fR.
138
If the key file is "-", stdin will be used. This is different from how cryptsetup usually reads from stdin. See section \fBNOTES ON PASSWORD PROCESSING\fR for more information.
167
use file as key material.
169
With LUKS, key material supplied in key files via \-d are always used for existing passphrases,
170
except in \fIluksFormat\fR action where \-d is equivalent to positional key file argument.
171
If you want to set a new key via a key file, you have to use a positional arg to \fIluksAddKey\fR.
173
If the key file is "-", stdin will be used. With the "-" key file reading will
174
not stop when new line character is detected. See section \fBNOTES ON PASSWORD PROCESSING\fR for more information.
140
176
.B "\-\-master-key-file"
141
177
Use pre-generated master key stored in file. For \fIluksFormat\fR it allows LUKS header reformatting with the same master key (if all other parameters are the same existing encrypted data remains intact).
146
182
For LUKS operations that add key material, this options allows to you specify which key slot is selected for the new key. This option can be used for \fIluksFormat\fR and \fIluksAddKey\fR.
148
184
.B "\-\-key-size, \-s"
149
set key size in bits. Has to be a multiple of 8 bits. The key size is limited by the used cipher. See output of /proc/crypto for more information. Can be used for \fIcreate\fR or \fIluksFormat\fR, all other LUKS actions will use key-size specified by the LUKS header. Default is 128 for \fIluksFormat\fR and 256 for \fIcreate\fR.
185
set key size in bits.
187
Has to be a multiple of 8 bits. The key size is limited by the used cipher. See output of /proc/crypto for more information.
188
Can be used for \fIcreate\fR or \fIluksFormat\fR, all other LUKS actions will use key-size specified by the LUKS header.
189
Default is set during compilation, if not changed it is 256 bits.
191
Use \fIcryptsetup \-\-help\fR to show defaults.
151
193
For \fIluksOpen\fR this option specifies number of bits read from the key-file (default is exhaustive read from key-file).
186
228
Show the version.
188
230
.SH NOTES ON PASSWORD PROCESSING
189
\fIFrom a file descriptor or a terminal\fR: Password processing is new-line sensitive, meaning the reading will stop after encountering \\n. It will process the read material (without newline) with the default hash or the hash given by \-\-hash. After hashing, it will be cropped to the key size given by \-s.
231
\fIFrom a terminal\fR: Password processing is new-line sensitive, meaning the reading will stop after encountering \\n. It will process the read material (without newline) with the default hash or the hash given by \-\-hash. After hashing, it will be cropped to the key size given by \-s.
191
233
\fIFrom stdin\fR: Reading will continue until EOF (so using e.g. /dev/random as stdin will not work), with the trailing newline stripped. After that the read data will be hashed with the default hash or the hash given by \-\-hash and the result will be cropped to the keysize given by \-s. If "plain" is used as an argument to the hash option, the input data will not be hashed.
192
234
Instead, it will be zero padded (if shorter than the keysize) or truncated (if longer than the keysize) and used directly as the key. No warning will be given if the amount of data read from stdin is less than the keysize.
196
238
If \-\-key-file=- is used for reading the key from stdin, no trailing newline is stripped from the input. Without that option, cryptsetup strips trailing newlines from stdin input.
197
239
.SH NOTES ON PASSWORD PROCESSING FOR LUKS
198
LUKS uses PBKDF2 to protect against dictionary attacks (see RFC 2898).
240
LUKS uses PBKDF2 to protect against dictionary attacks (see RFC 2898).
200
242
LUKS will always do an exhaustive password reading. Hence, password can not be read from /dev/random, /dev/zero or any other stream that does not terminate.
202
LUKS saves the processing options when a password is set to the respective key slot.
203
Therefore, no options can be given to luksOpen.
204
244
For any password creation action (luksAddKey, or luksFormat), the user may specify how much the time the password processing should consume.
205
245
Increasing the time will lead to a more secure password, but also will take luksOpen longer to complete. The default setting of one second is sufficient for good security.
206
246
.SH INCOHERENT BEHAVIOUR FOR INVALID PASSWORDS/KEYS
207
247
LUKS checks for a valid password or key when an encrypted partition is unlocked. Thus the luksOpen action fails with invalid password or key, contrary to the plain dm-crypt create action.
249
Please also be sure that you are using the same keyboard and language setting as during device format.
208
250
.SH NOTES ON SUPPORTED CIPHERS, MODES, HASHES AND KEY SIZES
209
251
The available combinations of ciphers, modes, hashes and key sizes depend on kernel support. See /proc/crypto for a list of available options. You might need to load additional kernel crypto modules in order to get more options.
211
For --hash option all algorithms supported by gcrypt library are available.
253
For \-\-hash option all algorithms supported by gcrypt library are available.
212
254
.SH NOTES ON PASSWORDS
213
255
Mathematics can't be bribed. Make sure you keep your passwords safe. There are a few nice tricks for constructing a fallback, when suddenly out of (or after being) blue, your brain refuses to cooperate. These fallbacks are possible with LUKS, as it's only possible with LUKS to have multiple passwords.
244
286
identical to luksKillSlot, but deprecated action name. This option was
245
287
renamed, as we introduced luksRemoveKey, a softer method for disabling
246
288
password slots. To make a clear distinction that luksDelKey was more brutal than luksRemoveKey
290
\fI\-\-non-exclusive\fR
292
This option is ignored. Non-exclusive access to the same block device
293
can cause data corruption thus this mode is no longer supported by cryptsetup.
249
295
.SH "REPORTING BUGS"
250
Report bugs to <dm-crypt@saout.de>.
296
Report bugs to <dm-crypt@saout.de> or Issues section on LUKS website.
297
Please attach output of failed command with added \-\-debug option.
252
299
Copyright \(co 2004 Christophe Saout
254
301
Copyright \(co 2004-2006 Clemens Fruhwirth
303
Copyright \(co 2009-2010 Red Hat, Inc.
256
305
This is free software; see the source for copying conditions. There is NO
257
306
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.