~ubuntu-branches/ubuntu/oneiric/cryptsetup/oneiric

« back to all changes in this revision

Viewing changes to man/cryptsetup.8

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2010-06-14 21:47:28 UTC
  • mfrom: (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100614214728-tm8kdwg6chjejlbq
Tags: 2:1.1.2-1ubuntu1
* Merge from Debian unstable (LP: #594365).  Remaining changes:
  - debian/control:
    + Bump initramfs-tools Suggests to Depends: so system is not
      potentially rendered unbootable.
    + Depend on plymouth.   
  - Add debian/cryptdisks-{enable,udev}.upstart.
  - debian/cryptdisks.functions:
    + new function, crypttab_start_one_disk, to look for the named source
      device in /etc/crypttab (by device name, UUID, or label) and start it
      if configured to do so
    + wrap the call to /lib/cryptsetup/askpass with watershed, to make sure
      we only ever have one of these running at a time; otherwise multiple
      invocations could steal each other's input and/or write over each
      other's output
    + initially create the device under a temporary name and rename it only
      at the end using 'dmsetup rename', to ensure that upstart/mountall
      doesn't see our device before it's ready to go.
    + do_tmp should mount under /var/run/cryptsetup for changing the
      permissions of the filesystem root, not directly on /tmp, since
      mounting on /tmp a) is racy, b) confuses mountall something fierce.
    + when called by cryptdisks-enable, check that we don't already have a
      corresponding cryptdisks-udev job running (probably waiting for a
      passphrase); if there is, wait until it's finished before continuing.
  - debian/cryptdisks{,-early}.init: Make the 'start' action of the init
    script a no-op, this should be handled entirely by the upstart job;
    and fix the LSB header to not declare this should be started in
    runlevel 'S'
  - debian/cryptsetup.postinst: Remove any symlinks from /etc/rcS.d on
    upgrade. 
  - debian/rules: Do not install start symlinks for init scripts, and
    install debian/cryptdisks-{enable,udev}.upstart scripts.
  - Add debian/cryptsetup.apport: Apport package hook. Install in
    debian/rules and create dir in debian/cryptsetup.dirs.
  - debian/rules: link dynamically against libgcrypt and libgpg-error.
  - debian/cryptsetup.postrm: call update-initramfs on package removal.
* Dropped changes, merged/superseded in Debian:
  - Add ext4 support to passdev.
  - cryptroot-hook: don't call copy_modules_dir with empty arguments when
    archcrypto isn't found
  - Set USPLASH=y and FRAMEBUFFER=y in the hook config to pull plymouth into
    the initramfs.
  - change interaction to use plymouth directly if present, and if not, to
    fall back to /lib/cryptsetup/askpass as before
  - cryptdisks.functions: replace 'echo -e' bashism with 'printf'.
  - debian/initramfs/cryptroot-script: if plymouth is present in the
    initramfs, use this directly, bypassing the cryptsetup askpass script
  - debian/initramfs/cryptroot-hook: Properly anchor our regexps when
    grepping /etc/crypttab so that we don't incorrectly match device names
    that are substrings of one another.
  - debian/initramfs/cryptroot-script: Don't leak /conf/conf.d/cryptroot
    file descriptor to subprocesses.
  - Fix grammar error in debian/initramfs/cryptroot-script
    ("setup" -> "set up")
  - debian/initramfs/cryptroot-script: Fix this to work with current
    initramfs-tools:
    + Source /scripts/functions after checking for prerequisites.
    + prereqs(): Do not assume we are running within initramfs, and
      calculate relative path correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH CRYPTSETUP "8" "March 2005" "cryptsetup" "Maintenance Commands"
 
1
.TH CRYPTSETUP "8" "" "cryptsetup" "Maintenance Commands"
2
2
.SH NAME
3
3
cryptsetup - setup cryptographic volumes for dm-crypt (including LUKS extension)
4
4
.SH SYNOPSIS
5
5
 
6
6
.B cryptsetup <options> <action> <action args>
7
 
 
8
7
.SH DESCRIPTION
9
 
.\" Add any additional description here
10
8
.PP
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.
12
11
.SH ACTIONS
13
12
These strings are valid for \fB<action>\fR, followed by their \fB<action args>\fR:
14
13
 
15
14
\fIcreate\fR <name> <device>
16
15
.IP
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]
 
17
 
 
18
\fB<options>\fR can be [\-\-hash, \-\-cipher, \-\-verify-passphrase, \-\-key-file, \-\-key-size, \-\-offset, \-\-skip, \-\-readonly]
19
19
.PP
20
20
\fIremove\fR <name>
21
21
.IP
22
 
removes an existing mapping <name>. No options.
 
22
removes an existing mapping <name>.
23
23
.PP
24
24
\fIstatus\fR <name>
25
25
.IP
26
 
reports the status for the mapping <name>. No options.
 
26
reports the status for the mapping <name>.
27
27
.PP
28
28
\fIresize\fR <name>
29
29
.IP
41
41
\fIluksFormat\fR <device> [<key file>]
42
42
.IP
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].
 
44
 
 
45
\fB<options>\fR can be [\-\-cipher, \-\-verify-passphrase, \-\-key-size, \-\-key-slot,
 
46
\-\-key-file (takes precedence over optional second argument)].
 
47
 
45
48
.PP
46
49
\fIluksOpen\fR <device> <name>
47
50
.IP
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].
 
52
 
 
53
\fB<options>\fR can be [\-\-key-file, \-\-readonly].
50
54
.PP
51
55
\fIluksClose\fR <name>
52
56
.IP
62
66
.PP
63
67
\fIluksResume\fR <name>
64
68
.IP
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).
 
71
 
 
72
\fB<options>\fR can be [\-\-key-file]
66
73
.PP
67
74
\fIluksAddKey\fR <device> [<new key file>]
68
75
.IP
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.
 
78
 
 
79
\fB<options>\fR can be [\-\-key-file, \-\-key-slot].
70
80
.PP
71
81
\fIluksRemoveKey\fR <device> [<key file>] 
72
82
.IP
74
84
.PP
75
85
\fIluksKillSlot\fR <device> <key slot number>
76
86
.IP
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.
 
89
 
 
90
\fB<options>\fR can be [\-\-key-file].
78
91
.PP
79
92
\fIluksDelKey\fR <device> <key slot number>
80
93
.IP
82
95
.PP
83
96
\fIluksUUID\fR <device>
84
97
.IP
85
 
print UUID, if <device> has a LUKS header. No options.
 
98
print UUID, if <device> has a LUKS header.
86
99
.PP
87
100
\fIisLuks\fR <device>
88
101
.IP
89
 
returns true, if <device> is a LUKS partition. Otherwise, false. No options.
 
102
returns true, if <device> is a LUKS partition. Otherwise, false.
90
103
.PP
91
104
\fIluksDump\fR <device>
92
105
.IP
93
 
dumps the header information of a LUKS partition. No options.
 
106
dumps the header information of a LUKS partition.
94
107
.PP
95
 
\fIluksHeaderBackup\fR <device> --header-backup-file <file>
 
108
\fIluksHeaderBackup\fR <device> \-\-header-backup-file <file>
96
109
.IP
97
110
Stores binary backup of LUKS header and keyslot areas.
98
111
 
100
113
 
101
114
Also note that anti-forensic splitter is not used during manipulation with backup file.
102
115
.PP
103
 
\fIluksHeaderRestore\fR <device> --header-backup-file <file>
 
116
\fIluksHeaderRestore\fR <device> \-\-header-backup-file <file>
104
117
.IP
105
118
 
106
119
Restores binary backup of LUKS header and keyslot areas from specified file.
114
127
 
115
128
.SH OPTIONS
116
129
.TP
 
130
.B "\-\-verbose, \-v"
 
131
Print more verbose messages.
 
132
.TP
 
133
.B "\-\-debug"
 
134
Run in debug mode with full diagnostic logs.
 
135
.TP
117
136
.B "\-\-hash, \-h"
118
137
For \fIcreate\fR action specifies hash to use for password hashing.
119
138
 
122
141
\fBWARNING:\fR setting hash other than \fBsha1\fR causes LUKS device incompatible with older version of cryptsetup.
123
142
 
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.
 
146
 
 
147
Use \fIcryptsetup \-\-help\fR to show defaults.
126
148
.TP
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".
129
 
 
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.
 
151
 
 
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".
 
156
 
 
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".
 
159
 
 
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).
131
162
.TP
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.
134
165
.TP
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.
137
 
 
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.
 
168
 
 
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.
 
172
 
 
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.
139
175
.TP
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.
147
183
.TP
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.
 
186
 
 
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.
 
190
 
 
191
Use \fIcryptsetup \-\-help\fR to show defaults.
150
192
 
151
193
For \fIluksOpen\fR this option specifies number of bits read from the key-file (default is exhaustive read from key-file).
152
194
.TP
186
228
Show the version.
187
229
 
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.
190
232
 
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.
195
237
 
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).
199
241
 
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.
201
243
 
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.
 
248
 
 
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.
210
252
 
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.
214
256
.SH AUTHORS
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
247
 
 
 
289
.PP
 
290
\fI\-\-non-exclusive\fR
 
291
.IP
 
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.
248
294
 
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.
251
298
.SH COPYRIGHT
252
299
Copyright \(co 2004 Christophe Saout
253
300
.br
254
301
Copyright \(co 2004-2006 Clemens Fruhwirth
 
302
.br
 
303
Copyright \(co 2009-2010 Red Hat, Inc.
255
304
 
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.