LUKS is used for Full Disk Encryption, among other things. Sometimes, after you have set this up, you find you need a second passphrase, or you need to replace an existing passphrase. One recent example for me was when I retasked a laptop with an encrypted file system for another employee. They really needed most of the stuff on there, and it was a recent install, so I did not want to rebuild from scratch. However, I did not want to give her my passphrase either.
Another scenario is when you want a user to have a passphrase, but you also want a separate passphrase that IT can use to get in if necessary.
Following assumes you have a disk set up with LUKS, and you want to add or change the passphrase for it. This is based on a Devuan system install, though it should work for any Linux based system.
The following assumes /dev/sda5 is the partition that is encrypted (discover in step 1)
blkid -t TYPE=crypto_LUKS -o device
cryptsetup luksDump /dev/sda5 | grep Key.Slot
cryptsetup luksChangeKey /dev/sda5 -S 2
The following assumes /dev/sda5 is the partition that is encrypted (discover in step 1)
blkid -t TYPE=crypto_LUKS -o device
cryptsetup luksDump /dev/sda5 | grep Key.Slot
cryptsetup luksAddKey /dev/sda5
The following assumes /dev/sda5 is the partition that is encrypted (discover in step 1)
blkid -t TYPE=crypto_LUKS -o device
cryptsetup luksDump /dev/sda5 | grep Key.Slot
cryptsetup luksKillSlot /dev/sda5 2