LUKS encryption, header on a dongle USBdrive?
Matthew Barrera
I am going to install Linux the LUKS/LVM way, in order to have an encrypted disk.
In addition, I would like to put the header and passphrase in a USB Key.
Thus, instead of entering the passphrase, I only plug the USB drive dongle.
Is it possible and how?
11 Answer
I am writing now from the machine that works exactly that way.
- First, you will need to put whole
/bootfolder on the dongle. - Encrypt the disk with key file and put the keyfile into the boot dongle too.
Edit
/etc/crypttab, add this linesda2_crypt UUID=14-88 /dev/disk/by-uuid/88-14:/rootfs.key luks,keyscript=/lib/cryptsetup/scripts/passdev
where sda2_crypt is arbitrary name, first UUID is of encrypted root partition, second - of dongle partition and rootfs.key is the keyfile name.
- Then Update your
/etc/fstabaccordingly. - Mount dongle as
/bootand doupdate-initramfs
This should be enough. Different instructions suggest you to add kernel boot arguments, but in my case it worked without.If you ever want to use password instead of keyfile, just edit /etc/crypttab and do update-initramfs.