1CRYPTSETUP-TOKEN(8)          Maintenance Commands          CRYPTSETUP-TOKEN(8)
2
3
4

NAME

6       cryptsetup-token - manage LUKS2 tokens
7

SYNOPSIS

9       cryptsetup token <add|remove|import|export|unassign> [<options>]
10       <device>
11

DESCRIPTION

13       Action add creates a new keyring token to enable auto-activation of the
14       device. For the auto-activation, the passphrase must be stored in
15       keyring with the specified description. Usually, the passphrase should
16       be stored in user or user-session keyring. The token command is
17       supported only for LUKS2.
18
19       For adding new keyring token, option --key-description is mandatory.
20       Also, new token is assigned to key slot specified with --key-slot
21       option or to all active key slots in the case --key-slot option is
22       omitted.
23
24       To remove existing token, specify the token ID which should be removed
25       with --token-id option.
26
27       WARNING: The action token remove removes any token type, not just
28       keyring type from token slot specified by --token-id option.
29
30       Action import can store arbitrary valid token json in LUKS2 header. It
31       may be passed via standard input or via file passed in --json-file
32       option. If you specify --key-slot then successfully imported token is
33       also assigned to the key slot.
34
35       Action export writes requested token JSON to a file passed with
36       --json-file or to standard output.
37
38       Action unassign removes token binding to specified keyslot. Both token
39       and keyslot must be specified by --token-id and --key-slot parameters.
40
41       If --token-id is used with action add or action import and a token with
42       that ID already exists, option --token-replace can be used to replace
43       the existing token.
44
45       <options> can be [--header, --token-id, --key-slot, --key-description,
46       --disable-external-tokens, --disable-locks, --disable-keyring,
47       --json-file, --token-replace, --unbound].
48

OPTIONS

50       --json-file
51           Read token JSON from a file or write token to it. --json-file=-
52           reads JSON from standard input or writes it to standard output
53           respectively.
54
55       --token-replace
56           Replace an existing token when adding or importing a token with the
57           --token-id option.
58
59       --key-slot, -S <0-N>
60           For LUKS operations that add key material, this option allows you
61           to specify which key slot is selected for the new key.
62
63           The maximum number of key slots depends on the LUKS version. LUKS1
64           can have up to 8 key slots. LUKS2 can have up to 32 key slots based
65           on key slot area size and key size, but a valid key slot ID can
66           always be between 0 and 31 for LUKS2.
67
68       --header <device or file storing the LUKS header>
69           Use a detached (separated) metadata device or file where the LUKS
70           header is stored. This option allows one to store ciphertext and
71           LUKS header on different devices.
72
73           For commands that change the LUKS header (e.g. luksAddKey), specify
74           the device or file with the LUKS header directly as the LUKS
75           device.
76
77       --disable-external-tokens
78           Disable loading of plugins for external LUKS2 tokens.
79
80       --disable-locks
81           Disable lock protection for metadata on disk. This option is valid
82           only for LUKS2 and ignored for other formats.
83
84           WARNING: Do not use this option unless you run cryptsetup in a
85           restricted environment where locking is impossible to perform
86           (where /run directory cannot be used).
87
88       --disable-keyring
89           Do not load volume key in kernel keyring and store it directly in
90           the dm-crypt target instead. This option is supported only for the
91           LUKS2 type.
92
93       --key-description <text>
94           Set key description in keyring for use with token command.
95
96       --token-id
97           Specify token number. If omitted, first unused token id is used
98           when adding or importing new token.
99
100       --unbound
101           Creates new LUKS2 keyring token assigned to no keyslot. Usable only
102           with add action.
103
104       --batch-mode, -q
105           Suppresses all confirmation questions. Use with care!
106
107           If the --verify-passphrase option is not specified, this option
108           also switches off the passphrase verification.
109
110       --debug or --debug-json
111           Run in debug mode with full diagnostic logs. Debug output lines are
112           always prefixed by #.
113
114           If --debug-json is used, additional LUKS2 JSON data structures are
115           printed.
116
117       --version, -V
118           Show the program version.
119
120       --usage
121           Show short option help.
122
123       --help, -?
124           Show help text and default parameters.
125

REPORTING BUGS

127       Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or
128       in Issues project section
129       <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
130
131       Please attach output of the failed command with --debug option added.
132

SEE ALSO

134       Cryptsetup FAQ
135       <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
136
137       cryptsetup(8), integritysetup(8) and veritysetup(8)
138

CRYPTSETUP

140       Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.
141
142
143
144cryptsetup 2.6.1                  2023-02-10               CRYPTSETUP-TOKEN(8)
Impressum