[dm-crypt] luksAddKey one liner

Frederick Gotham <[email protected]>
Newsgroups de.saout.dm-crypt
Message-ID <trinity-237414ab-7521-493a-a8ef-6baeebc796e6-1599777034940@3c-app-mailcom-bs03>
Let's say you create a new volume as follows:

    echo -n pass0 | cryptsetup luksFormat /dev/sda2 -

So the password in keyslot #0 is "pass0".

Next, you want to set the password in keyslot #1 to "pass1", well I figured out how to do it with a one-liner:

    echo -n "pass0pass1" | cryptsetup luksAddKey --key-file /dev/stdin --keyfile-size 5 --key-slot 1 /dev/sda2 /dev/stdin
 
Frederick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.