CRYPTSETUP-TOKEN(8)
π CRYPTSETUP-TOKEN(8) π
okay bestie, so this is a page from the Maintenance Commands section of the manual β it's the cryptsetup-token page, and it's literally all about managing LUKS2 tokens. pull up a chair, we're doing this together π«Ά
β¨ NAME β¨
cryptsetup-token β manage LUKS2 tokens π
β¨ SYNOPSIS β¨
cryptsetup token <add|remove|import|export|unassign> [<options>]
<device>
β¨ DESCRIPTION β¨
k so the action add creates a new keyring token that enables auto-activation of the device. for the auto-activation to work, the passphrase has to be stored in the keyring with the specified description. usually you'd store that passphrase in the user or user-session keyring. also important: the token command is supported only for LUKS2. no LUKS1 girlies here, sorry π
for adding a new keyring token, the option --key-description is mandatory β like, you genuinely cannot skip it. also, a new token gets assigned to the keyslot specified with the --key-slot option, or to all active keyslots if the --key-slot option is omitted.
to remove an existing token, specify the token ID that should be removed with the --token-id option.
β οΈ WARNING: the actiontoken removeremoves any token type, not just keyring type, from the token slot specified by the--token-idoption. read that again bestie, it's not picky π
action import can store an arbitrary valid JSON data in the LUKS2 token. it may be passed via standard input or a file passed in the --json-file option. if you specify --key-slot, a successfully imported token is also assigned to the keyslot.
action export writes the requested token JSON to a file passed with --json-file or to standard output.
action unassign removes the token binding to the specified keyslot. both the token and the keyslot must be specified by the --token-id and --key-slot parameters.
if --token-id is used with action add or action import and a token with that ID already exists, the option --token-replace can replace the existing token. slay β¨
<options> can be [--header, --token-id, --key-slot, --key-description, --disable-external-tokens, --disable-locks, --disable-keyring, --json-file, --token-replace, --unbound, --external tokens-path].
β¨ OPTIONS β¨
--batch-mode,-qβ suppresses all confirmation questions. use with care! π¬
if the --verify-passphrase option is not specified, this option also switches off the passphrase verification.
--debugor--debug-jsonβ run in debug mode with full diagnostic logs. debug output lines are always prefixed by#.
if --debug-json is used, additional LUKS2 JSON data structures are printed. it's giving "here's the tea, in full" π
--disable-external-tokensβ disable loading of plugins for external LUKS2 tokens.--disable-keyringβ do not load the volume key in the kernel keyring; store it directly in thedm-crypttarget instead. this option is supported only for the LUKS2 type.--disable-locksβ disable lock protection for metadata on disk. this option is valid only for LUKS2 and is ignored for other formats.
β οΈ WARNING: do not use this option unless you run cryptsetup in a restricted environment where locking is impossible to perform (where /run directory cannot be used). fr fr, don't be brave about this one π
--external-tokens-path <absolute path>β override the system directory path where cryptsetup searches for external token handlers (or token plugins). it must be an absolute path (starting with/character).--header <device or file storing the LUKS header>β use a detached (separated) metadata device or file where the LUKS header is stored. this option allows one to store the ciphertext and LUKS header on different devices.
for commands that change the LUKS header (e.g., luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.
--help,-?β show help text and default parameters. π«Ά--json-fileβ read the token JSON from a file or write the token to it. option--json-file=-reads JSON from standard input or writes it to standard output, respectively.--key-description textβ set the key description in the keyring that will be used for passphrase retrieval.--key-slot,-S <0-N>β for LUKS operations that add key material, this option allows you to specify which keyslot is selected for the new key.
the maximum number of keyslots depends on the LUKS version. LUKS1 can have up to 8 keyslots. LUKS2 can have up to 32 keyslots based on keyslot area size and key size, but a valid keyslot ID can always be between 0 and 31 for LUKS2.
--token-idβ specify the token number. if omitted, the first unused token id is used when adding or importing a new token.--token-replaceβ replace an existing token when adding or importing a token with the--token-idoption. main character energy: out with the old π--unboundβ creates a new LUKS2 keyring token assigned to no keyslot. usable only with theaddaction.--usageβ show short option help.--version,-Vβ show the program version.
β¨ REPORTING BUGS β¨
found a bug? π report it at the cryptsetup mailing list <cryptsetup@lists.linux.dev> or in the Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
pls pls pls attach the output of the failed command with the --debug option added β it helps so much π«Ά
β¨ SEE ALSO β¨
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
cryptsetup(8), integritysetup(8) and veritysetup(8) π
β¨ CRYPTSETUP β¨
part of the cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>. π
and that's the whole page bestie, you ate that π this was cryptsetup 2.8.8, dated 2026-09-07 β catch you on the next manpage, mwah ππ¦
π¦ where this page comes from
- arch rolling: cryptsetup 2.8.8-1 Β· GPL-2.0-or-later
- fedora 44: cryptsetup 2.8.8-1.fc44 Β· GPL-2.0-or-later WITH cryptsetup-OpenSSL-exception AND LGPL-2.1-or-later WITH cryptsetup-OpenSSL-exception
- nixpkgs unstable: cryptsetup 2.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms