NVME-KEYS-IMPORT(1)
π nvme-keys-import β bestie's guide to importing keys β¨
okay so this is a page from the NVMe Manual, and it's all about nvme-keys-import(1) β the glow-up command that imports NVMeoF TLS PSKs or KX-HMAC-CHAP secrets into a keyring. let's get into it π«Ά
πΈ SYNOPSIS πΈ
like, here's the whole vibe in one block:
nvme [<global-options>] keys import [--keyring=<name> | -k <name>]
[--keyfile=<file> | -f <file>]
[--keydata=<key> | -d <key>]
[--identity=<identity> | -i <identity>]
that's it. that's the whole thing. no cap π
β¨ DESCRIPTION β¨
so this command imports one or more already-identified keys into a keyring. bestie, the key type is auto-detected from the key's prefix β either NVMeTLSkey-1: (TLS PSK) or DHHC-1: (KX-HMAC-CHAP host secret). it just knows. main character energy fr π₯
π₯ bulk mode (no --identity)
without --identity, keys are read in bulk. the key data is read in this form:
<description> <key>
where <description> is the key description β like, the TLS PSK identity for a TLS PSK β and <key> is either:
- a TLS PSK in interchange format
NVMeTLSkey-1:<hmac>:<base64 encoded data>:, or - a KX-HMAC-CHAP secret in the form
DHHC-1:<hmac>:<base64 encoded data>:
one key per line, and they get imported into the kernel keyring. this is the exact format produced by nvme-keys-export(1), so it's giving round-trip π
π― single-key mode (with --identity)
with --identity, a single key is imported instead: the key is read from --keydata (or, if that's not given, from stdin) and stored under the given identity. this is the way to insert a single KX-HMAC-CHAP secret, or a previously derived TLS PSK, directly by identity β no keyfile needed. lowkey convenient π¦
β οΈ heads up: this command does not derive a TLS PSK from a configured PSK, and it does not compute the identity to store it under from a host/subsystem NQN pair. for that, use nvme-keys-insert-tls-psk(1). different command, different job, iykyk π
π OPTIONS π
-k <name>,--keyring=<name>β the name of the keyring you're importing the keys into. default is.nvme. yes, with the dot. iconic.-f <file>,--keyfile=<file>β file to read the keys from instead of stdin. only used in bulk mode (i.e. when--identityis not given). slay.-d <key>,--keydata=<key>β the key to be inserted when--identityis given. if you don't give it, the key is read from stdin. π-i <identity>,--identity=<identity>β identity to store a single key under. if given,--keydata(or stdin) is read as a single key instead of a bulk<description> <key>list. periodt.
π GLOBAL OPTIONS π
these ones live at the top-level nvme command and are available to this subcommand too. so you can absolutely use them here π
--dry-runβ print the command that would be executed, but don't actually execute it. like a little dress rehearsal π§--no-ioctl-probingβ disable probing for 64-bit IOCTL support.--no-retriesβ disable retry logic on transient errors. one shot, no takebacks.-o <fmt>,--output-format=<fmt>β set the reporting format tonormal,tabular,'json, orbinary. only one output format may be used at a time, bestie. pick one. π--output-format-version=<version>β select the output format version. version 1 uses the original field naming, while version 2 (default) provides more consistent and script-friendly field names. other versions are rejected. rude but fair.--quietβ suppress informational messages. errors are still reported, and--quietcancels any--verbosefor the library log level. shhh π€«--set-options=<key=value>[,<key=value>...]β set libnvme library options for this invocation. supported keys areforce-4k,mi-probe-enabled,test-base-dirandtest-sysfs-dir.--timeout=<ms>β set the timeout for the command in milliseconds.infiniteor-1waits without a time limit (0xffffffff). no clock, no stress β-v,--verboseβ increase the level of detail in the output. may be specified multiple times to further increase verbosity. go off, be as verbose as you want π£οΈ
these options can also be set as machine-wide defaults in nvme-cli.conf(5). a command-line flag always overrides the file. always. π
π₯ EXAMPLES π₯
1. import previously exported keys from a file and verify with keyctl
# nvme keys import -f nvme-tls-keys.txt
# keyctl show
Session Keyring
573249525 --alswrv 0 0 keyring: _ses
353599402 --alswrv 0 65534 \_ keyring: _uid.0
475911922 ---lswrv 0 0 \_ keyring: .nvme
734343968 --als-rv 0 0 \_ psk: NVMe0R01 hostnqn0 subsys0
look at that tree. beautiful. the little psk: baby at the bottom? that's your key. ate and left no crumbs ππ
2. import a single KX-HMAC-CHAP secret under an explicit identity
# nvme keys import -i host2 -d DHHC-1:00:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n:
one key, one identity, zero drama. that's the whole move π¦
π NVME π
part of the nvme-user suite. you're in good company, bestie π
and that's the page!! written by the NVMe crew, dated 10/30/2026, and rendered right back at you as NVME-KEYS-IMPORT(1). go forth and import those keys β you're literally gonna slay β¨ππ
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms