'\" t .\" Title: cryptsetup-token .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-05 .\" Manual: Maintenance Commands .\" Source: cryptsetup 2.6.1 .\" Language: English .\" .TH "CRYPTSETUP\-TOKEN" "8" "2024-01-05" "cryptsetup 2.6.1" "Maintenance Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" cryptsetup-token \- manage LUKS2 tokens .SH "SYNOPSIS" .sp \fBcryptsetup \fItoken\fP [] \fP .SH "DESCRIPTION" .sp Action \fIadd\fP creates a new keyring token to enable auto\-activation of the device. For the auto\-activation, the passphrase must be stored in keyring with the specified description. Usually, the passphrase should be stored in \fIuser\fP or \fIuser\-session\fP keyring. The \fItoken\fP command is supported only for LUKS2. .sp For adding new keyring token, option \-\-key\-description is mandatory. Also, new token is assigned to key slot specified with \-\-key\-slot option or to all active key slots in the case \-\-key\-slot option is omitted. .sp To remove existing token, specify the token ID which should be removed with \-\-token\-id option. .sp \fBWARNING:\fP The action \fItoken remove\fP removes any token type, not just \fIkeyring\fP type from token slot specified by \-\-token\-id option. .sp Action \fIimport\fP can store arbitrary valid token json in LUKS2 header. It may be passed via standard input or via file passed in \-\-json\-file option. If you specify \-\-key\-slot then successfully imported token is also assigned to the key slot. .sp Action \fIexport\fP writes requested token JSON to a file passed with \-\-json\-file or to standard output. .sp Action \fIunassign\fP removes token binding to specified keyslot. Both token and keyslot must be specified by \-\-token\-id and \-\-key\-slot parameters. .sp If \-\-token\-id is used with action \fIadd\fP or action \fIimport\fP and a token with that ID already exists, option \-\-token\-replace can be used to replace the existing token. .sp \fB\fP can be [\-\-header, \-\-token\-id, \-\-key\-slot, \-\-key\-description, \-\-disable\-external\-tokens, \-\-disable\-locks, \-\-disable\-keyring, \-\-json\-file, \-\-token\-replace, \-\-unbound]. .SH "OPTIONS" .sp \fB\-\-json\-file\fP .RS 4 Read token JSON from a file or write token to it. \-\-json\-file=\- reads JSON from standard input or writes it to standard output respectively. .RE .sp \fB\-\-token\-replace\fP .RS 4 Replace an existing token when adding or importing a token with the \-\-token\-id option. .RE .sp \fB\-\-key\-slot, \-S <0\-N>\fP .RS 4 For LUKS operations that add key material, this option allows you to specify which key slot is selected for the new key. .sp The maximum number of key slots depends on the LUKS version. LUKS1 can have up to 8 key slots. LUKS2 can have up to 32 key slots based on key slot area size and key size, but a valid key slot ID can always be between 0 and 31 for LUKS2. .RE .sp \fB\-\-header \fP .RS 4 Use a detached (separated) metadata device or file where the LUKS header is stored. This option allows one to store ciphertext and LUKS header on different devices. .sp For commands that change the LUKS header (e.g. \fIluksAddKey\fP), specify the device or file with the LUKS header directly as the LUKS device. .RE .sp \fB\-\-disable\-external\-tokens\fP .RS 4 Disable loading of plugins for external LUKS2 tokens. .RE .sp \fB\-\-disable\-locks\fP .RS 4 Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. .sp \fBWARNING:\fP 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). .RE .sp \fB\-\-disable\-keyring\fP .RS 4 Do not load volume key in kernel keyring and store it directly in the dm\-crypt target instead. This option is supported only for the LUKS2 type. .RE .sp \fB\-\-key\-description \fP .RS 4 Set key description in keyring for use with \fItoken\fP command. .RE .sp \fB\-\-token\-id\fP .RS 4 Specify token number. If omitted, first unused token id is used when adding or importing new token. .RE .sp \fB\-\-unbound\fP .RS 4 Creates new LUKS2 keyring token assigned to no keyslot. Usable only with \fIadd\fP action. .RE .sp \fB\-\-batch\-mode, \-q\fP .RS 4 Suppresses all confirmation questions. Use with care! .sp If the \-\-verify\-passphrase option is not specified, this option also switches off the passphrase verification. .RE .sp \fB\-\-debug or \-\-debug\-json\fP .RS 4 Run in debug mode with full diagnostic logs. Debug output lines are always prefixed by \fB#\fP. .sp If \-\-debug\-json is used, additional LUKS2 JSON data structures are printed. .RE .sp \fB\-\-version, \-V\fP .RS 4 Show the program version. .RE .sp \fB\-\-usage\fP .RS 4 Show short option help. .RE .sp \fB\-\-help, \-?\fP .RS 4 Show help text and default parameters. .RE .SH "REPORTING BUGS" .sp Report bugs at \c .MTO "cryptsetup\(atlists.linux.dev" "\fBcryptsetup mailing list\fP" or in \c .URL "https://gitlab.com/cryptsetup/cryptsetup/\-/issues/new" "\fBIssues project section\fP" "." .sp Please attach output of the failed command with \-\-debug option added. .SH "SEE ALSO" .sp .URL "https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions" "\fBCryptsetup FAQ\fP" "" .sp \fBcryptsetup\fP(8), \fBintegritysetup\fP(8) and \fBveritysetup\fP(8) .SH "CRYPTSETUP" .sp Part of \c .URL "https://gitlab.com/cryptsetup/cryptsetup/" "\fBcryptsetup project\fP" "."