LFCS · Question #355
An administrator has created a mapping with the following command: cryptsetup luksOpen /dev/sda1 cryptvol and has set three different keys. Which command below will delete the first key?
The correct answer is A. cryptsetup luksDelKey /dev/sda1 0. To delete the first key from a LUKS device, use cryptsetup luksDelKey targeting the raw underlying device and specifying key slot 0.
Question
Options
- Acryptsetup luksDelKey /dev/sda1 0
- Bcryptsetup luksDelKey /dev/sda1 1
- Ccryptsetup luksDelKey /dev/mapper/cryptvol 1
- Dcryptsetup luksDelKey /dev/mapper/cryptvol 0
How the community answered
(46 responses)- A89% (41)
- B4% (2)
- C7% (3)
Why each option
To delete the first key from a LUKS device, use `cryptsetup luksDelKey` targeting the raw underlying device and specifying key slot `0`.
The `cryptsetup luksDelKey` command targets the underlying LUKS-encrypted physical device (e.g., `/dev/sda1`) where the LUKS header and key slots reside, and key slots are 0-indexed, so `0` refers to the first key slot.
Specifying `1` would delete the second key slot, not the first.
The `luksDelKey` operation is performed on the raw LUKS-encrypted device (`/dev/sda1`), not the active device mapper mapping (`/dev/mapper/cryptvol`), and `1` refers to the second key slot.
The `luksDelKey` operation is performed on the raw LUKS-encrypted device (`/dev/sda1`), not the active device mapper mapping (`/dev/mapper/cryptvol`).
Concept tested: `cryptsetup luksDelKey` usage and key slot indexing
Source: https://gitlab.com/cryptsetup/cryptsetup/-/wikis/DMCrypt
Topics
Community Discussion
No community discussion yet for this question.