Merge branch 'upstream' into tizen
[platform/upstream/cryptsetup.git] / man / cryptsetup-luksAddKey.8.adoc
1 = cryptsetup-luksAddKey(8)
2 :doctype: manpage
3 :manmanual: Maintenance Commands
4 :mansource: cryptsetup {release-version}
5 :man-linkstyle: pass:[blue R < >]
6 :COMMON_OPTIONS:
7 :ACTION_LUKSADDKEY:
8
9 == Name
10
11 cryptsetup-luksAddKey - add a new passphrase
12
13 == SYNOPSIS
14
15 *cryptsetup _luksAddKey_ [<options>] <device> [<key file with new key>]*
16
17 == DESCRIPTION
18
19 Adds a keyslot protected by a new passphrase. An existing passphrase
20 must be supplied interactively, via --key-file or LUKS2 token (plugin).
21 Alternatively to existing passphrase user may pass directly volume key
22 (via --volume-key-file). The new passphrase to be added can be specified
23 interactively, read from the file given as the positional argument (also
24 via --new-keyfile parameter) or via LUKS2 token.
25
26 *NOTE:* with --unbound option the action creates new unbound LUKS2
27 keyslot. The keyslot cannot be used for device activation. If you don't
28 pass new key via --volume-key-file option, new random key is generated.
29 Existing passphrase for any active keyslot is not required.
30
31 *NOTE:* some parameters are effective only if used with LUKS2 format
32 that supports per-keyslot parameters. For LUKS1, PBKDF type and hash
33 algorithm is always the same for all keyslots.
34
35 *<options>* can be [--key-file, --keyfile-offset, --keyfile-size,
36 --new-keyfile, --new-keyfile-offset, --new-keyfile-size, --key-slot,
37 --new-key-slot, --volume-key-file, --force-password, --hash, --header,
38 --disable-locks, --iter-time, --pbkdf, --pbkdf-force-iterations,
39 --pbkdf-memory, --pbkdf-parallel, --unbound, --type, --keyslot-cipher,
40 --keyslot-key-size, --key-size, --timeout, --token-id, --token-type,
41 --token-only, --new-token-id, --verify-passphrase].
42
43 include::man/common_options.adoc[]
44
45 == EXAMPLES
46
47 *NOTE*: When not specified otherwise interactive passphrase prompt is always default method.
48
49 Add new keyslot using interactive passphrase prompt for both existing and new passphrase:
50
51 *cryptsetup luksAddKey /dev/device*
52
53 Add new keyslot using LUKS2 tokens to unlock existing keyslot with interactive passphrase prompt for new passphrase:
54
55 *cryptsetup luksAddKey --token-only /dev/device*
56
57 Add new keyslot using LUKS2 systemd-tpm2 tokens to unlock existing keyslot with interactive passphrase prompt for new passphrase (systemd-tpm2 token plugin must be available):
58
59 *cryptsetup luksAddKey --token-type systemd-tpm2 /dev/device*
60
61 Add new keyslot using interactive passphrase prompt for existing keyslot, reading new passphrase from key_file:
62
63 *cryptsetup luksAddKey --new-keyfile key_file /dev/device* or
64 *cryptsetup luksAddKey /dev/device key_file*
65
66 Add new keyslot using volume stored in volume_key_file and LUKS2 token in slot 5 to get new keyslot passphrase (token in slot 5 must exist
67 and respective token plugin must be available):
68
69 *cryptsetup luksAddKey --volume-key-file volume_key_file --new-token-id 5 /dev/device*
70
71 include::man/common_footer.adoc[]