volume_key(8)
π NAME π
volume_key β work with volume encryption secrets and escrow packets
β¨ SYNOPSIS β¨
volume_key [OPTION]... OPERAND...
π¦ DESCRIPTION π¦
okay so bestie, volume_key is the girl who handles the "secrets" your volume encryption runs on β keys, passphrases, the whole vibe β and tucks them safely into separate encrypted "escrow packets". She can also take a packet you built earlier and use it to restore access to a volume (classic scenario: user forgot their passphrase, tragic), or just manipulate the info sitting inside escrow packets.
Which mode she's in, and which operands she wants, is decided by whichever one of --save, --restore, --setup-volume, --reencrypt, --dump or --secrets you hand her. The OPTIONS section has the details, iykyk.
π OPTIONS π
quick vibe check before anything else: in every option below, VOLUME means a LUKS device β not the plaintext device chillin' inside it:
blkid -s TYPE VOLUME
should report TYPE="crypto_LUKS". no cap. π«Ά
π the mode options (these pick your operation AND your operands)
--saveβ Expects operandsVOLUME [PACKET]. OpensVOLUME. IfPACKETis provided, it loads the secrets from it. Otherwise it extracts secrets fromVOLUME, prompting the user if necessary. Either way, it stores secrets in one or more output packets. πΎ--restoreβ Expects operandsVOLUME PACKET. OpensVOLUMEand uses the secrets inPACKETto makeVOLUMEaccessible again, prompting the user if necessary (e.g. by letting the user enter a new passphrase). π--setup-volumeβ Expects operandsVOLUME PACKET NAME. OpensVOLUMEand uses the secrets inPACKETto set upVOLUMEfor use of the decrypted data asNAME.- Currently
NAMEis a name of a dm-crypt volume, and this operation makes the decrypted volume available as/dev/mapper/NAME. - This operation should not permanently alter
VOLUME(e.g. by adding a new passphrase); the user can of course access and modify the decrypted volume, modifyingVOLUMEin the process.
- Currently
--reencryptβ Expects operandPACKET. OpensPACKET, decrypting it if necessary, and stores the information in one or more new output packets. π--dumpβ Expects operandPACKET. OpensPACKET, decrypting it if necessary, and outputs the contents ofPACKET. the secrets are not output by default β you gotta ask nicely.--secretsβ Expects operandPACKET. OpensPACKET, decrypting it if necessary, and outputs secrets contained inPACKET. π€«--helpβ Shows usage information.--versionβ Shows version ofvolume_key.
π the options that tweak how your operation behaves
-b,--batchβ Run in batch mode. Reads passwords and passphrases from standard input, each terminated by a NUL character. And if a packet does not match a volume exactly, it fails instead of prompting the user. β-d,--nss-dir DIRβ Uses private keys in the NSS database inDIRto decrypt public key-encrypted packets. π-o,--output PACKETβ Writes the default secret toPACKET.- Which secret counts as the default depends on the volume format: it should not be likely to expire, and it should allow restoring access to the volume using
--restore. π«
- Which secret counts as the default depends on the volume format: it should not be likely to expire, and it should allow restoring access to the volume using
--output-data-encryption-key PACKETβ Writes the data encryption key (the key directly used to encrypt the actual volume data) toPACKET. π--output-passphrase PACKETβ Writes a passphrase that can be used to access the volume toPACKET.--create-random-passphrase PACKETβ Generates a random alphanumeric passphrase, adds it toVOLUME(without affecting other passphrases) and stores the random passphrase intoPACKET. π²-c,--certificate CERTβ Loads a certificate from the file specified byCERTand encrypts all output packets using the public key contained in the certificate. If this option is not specified, all output packets are encrypted using a passphrase.- > note bestie:
CERTis a certificate file name, not a NSS certificate nickname. don't mix those up, it's giving heartbreak π
- > note bestie:
--output-format FORMATβ UsesFORMATfor all output packets.FORMATcan currently be one ofasymmetric(use CMS to encrypt the whole packet, requires a certificate),asymmetric_wrap_secret_only(wrap only the secret, requires a certificate),passphrase(use GPG to encrypt the whole packet, requires a passphrase).--unencryptedβ Only dumps the unencrypted parts of the packet, if any, with--dump. Does not require any passphrase or private key access. π--with-secretsβ Includes secrets in the output of--dump. π
π₯ EXIT STATUS π₯
volume_key returns with exit status 0 on success, 1 on error. that's the whole chart, periodt.
π NOTES π
The only currently supported volume format is LUKS. fr fr, that's the one.
π EXAMPLE π
okay here's the typical volume_key storyline, bestie. During system installation, or soon after, you back up the default secret of a volume, and you add a system-specific random passphrase. Encrypt both using a certificate:
volume_key --save VOLUME -c CERT -o PACKET_DEFAULT
--create-random-passphrase PACKET_PASSPHRASE
Then store PACKET_DEFAULT and PACKET_PASSPHRASE outside of the computer. π§ keep them somewhere else, that's the whole point.
If the user forgets a passphrase, and you can access the computer, decrypt PACKET_DEFAULT using the certificate private key (which should never leave a secure machine):
volume_key --reencrypt -d NSS_DB PACKET_DEFAULT -o
PACKET_DEFAULT_PW
Then boot the computer (e.g. using a "rescue mode"), copy PACKET_DEFAULT_PW to it, and restore access to the volume:
volume_key --restore VOLUME PACKET_DEFAULT_PW
If the user forgets the passphrase, and you cannot access the computer, decrypt the backup passphrase:
volume_key --secrets PACKET_PASSPHRASE
and tell the backup passphrase to the user. (You can later generate a new backup passphrase.) π β¨
that's a wrap, bestie β this was volume_key, living in section 8 of the System Manager's Manual, from the volume_key source, dated Jun 2011. go forth and escrow responsibly. ππΈ
π¦ where this page comes from
- alpine 3.24: volume_key-doc 0.3.12-r9 Β· GPL-2.0-or-later
- arch rolling: volume_key 0.3.12-12 Β· GPL2
- centos-stream 10: volume_key 0.3.12-27.el10 Β· GPL-2.0-only AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later)
- centos-stream 9: volume_key 0.3.12-17.el9 Β· GPLv2
- debian bookworm: volume-key 0.3.12-5+b1 Β· GPL-2.0-only
- debian trixie: volume-key 0.3.12-9 Β· GPL-2.0-only
- fedora 43: volume_key 0.3.12-28.fc43 Β· GPL-2.0-only AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later)
- fedora 44: volume_key 0.3.12-29.fc44 Β· GPL-2.0-only AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later)
- nixpkgs unstable: volume_key 0.3.11
- ubuntu jammy: volume-key 0.3.12-3.1build3 Β· GPL-2.0-only
- ubuntu noble: volume-key 0.3.12-7build2 Β· GPL-2.0-only
- ubuntu questing: volume-key 0.3.12-9
- ubuntu resolute: volume-key 0.3.12-10build2 Β· GPL-2.0-only
- ubuntu stonking: volume-key 0.3.12-10build2 Β· GPL-2.0-only
- Copyright (C) 2009, 2010, 2011 Red Hat, Inc. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms