table of contents
| NVME-KEYS-IMPORT(1) | NVMe Manual | NVME-KEYS-IMPORT(1) |
NAME¶
nvme-keys-import - Import NVMeoF TLS PSKs or KX-HMAC-CHAP keys into a keyring
SYNOPSIS¶
nvme [<global-options>] keys import [--keyring=<name> | -k <name>]
[--keyfile=<file> | -f <file>]
[--keydata=<key> | -d <key>]
[--identity=<identity> | -i <identity>]
DESCRIPTION¶
Imports one or more already-identified keys into a keyring. The key type (NVMe TLS PSK or KX-HMAC-CHAP host key) is auto-detected from the key’s prefix (NVMeTLSkey-1: or DHHC-1:).
Without --identity, keys are read in bulk. Key data is read in the form
<description> <key>
where <description> is the key description and <key> is either a TLS PSK in interchange format NVMeTLSkey-1:01:<base64 encoded data>: or a KX-HMAC-CHAP key in the form DHHC-1:00:<base64 encoded data>:, one key per line, and imported into the kernel keyring. This is the format produced by linknvme-keys-export[1].
With --identity, a single key is imported instead: the key is read from --keydata (or, if not given, from stdin) and stored under the given identity. This is the way to insert a single KX-HMAC-CHAP key, or a previously derived TLS retained key, directly by identity, without needing a keyfile.
Note that this command does not derive a retained TLS key identity from raw PSK material and a host/subsystem NQN pair; use linknvme-keys-insert-tls[1] for that.
OPTIONS¶
-k <name>, --keyring=<name>
-f <file>, --keyfile=<file>
-d <key>, --keydata=<key>
-i <identity>, --identity=<identity>
GLOBAL OPTIONS¶
The following options are defined at the top-level nvme command and are available to this subcommand:
--dry-run
--no-ioctl-probing
--no-retries
-o <fmt>, --output-format=<fmt>
--output-format-version=<version>
--timeout=<ms>
-v, --verbose
These options can also be set as machine-wide defaults in nvme-cli.conf(5). A command-line flag always overrides the file.
EXAMPLES¶
# 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
# nvme keys import -i host2 -d DHHC-1:00:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n:
NVME¶
Part of the nvme-user suite
| 07/31/2026 | NVMe |